Created
November 20, 2015 18:25
-
-
Save plablo09/8fbc74b1741b327cf791 to your computer and use it in GitHub Desktop.
select inside polygon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select 1 as id, st_geomfromtext( | |
'POLYGON ((-99.5408690000000007 19.9525709999999989, -99.5435870000000023 19.9554469999999995, -99.3506809999999945 20.0420480000000012, -99.3361179999999990 20.0463349999999991, | |
-99.1990940000000023 20.2146280000000012, | |
-99.1924779999999942 20.2391210000000008, | |
-99.1860319999999973 20.2430979999999998, | |
-99.1860300000000024 20.2430990000000008, | |
-98.9455770000000001 20.2654850000000017, | |
-98.9449809999999985 20.2654619999999994, | |
-98.9423579999999987 20.2606110000000008, | |
-98.8173819999999949 20.1350939999999987, -98.7599189999999965 20.1261369999999999, -98.7324749999999938 20.1274310000000014, -98.5636429999999990 20.2358669999999989, -98.4145270000000068 20.0966829999999987, -98.7129479999999973 20.0652369999999998, -98.5766100000000023 19.7826479999999982, -98.5761750000000063 19.7703230000000012, -98.5397349999999932 19.6572999999999993, -98.6620520000000027 19.3520900000000005, | |
-98.4457770000000068 19.2840899999999991, -98.4346189999999979 19.2822309999999995, | |
-98.2354019999999934 19.3239739999999998, -98.1616429999999980 19.4128660000000011, -98.1343090000000018 19.4144460000000016, -98.0918669999999935 19.3971680000000006, -98.0918609999999944 19.3971629999999990, | |
-97.9260189999999966 19.3154579999999996, -97.9193980000000010 19.2864819999999995, -97.9509120000000024 19.1048819999999999, -97.7832700000000017 18.9754110000000011, -97.6708210000000037 18.9054600000000015, -97.6601730000000003 18.8695820000000012, -97.7745989999999949 18.8972039999999986, | |
-97.8743429999999961 18.9477949999999993, -97.9117080000000044 18.9663819999999994, -98.1358429999999942 18.9377150000000007, -98.2158660000000054 18.9624050000000004, -98.2721970000000056 18.9685050000000004, -98.4213950000000040 18.9183109999999992, -98.4403999999999968 18.9045750000000012, | |
-98.4482600000000048 18.9075600000000001, -98.6471559999999954 19.0870549999999994, -98.7742250000000013 19.0564280000000004, -98.7742329999999953 19.0564350000000005, -98.7742449999999934 19.0564500000000017, -98.9984199999999959 19.1746170000000014, -99.0301180000000016 19.1667379999999987, -99.1592480000000052 19.2084370000000000, -99.1626550000000009 19.2105120000000014, -99.4431320000000056 19.2108220000000003, -99.4692790000000002 19.1807419999999986, -99.5875779999999935 19.2145879999999991, -99.6365679999999969 19.2208089999999991, -99.6606840000000034 19.2208240000000004, -99.7200639999999936 19.2764659999999992, -99.7201539999999937 19.2768259999999998, | |
-99.7365439999999950 19.3249509999999987, -99.8381660000000011 19.5612279999999998, -99.6875979999999942 19.4100700000000010, -99.4030209999999954 19.5735080000000004, -99.4499820000000057 19.6884000000000015, -99.5408690000000007 19.9525709999999989))' | |
,4326) as geom | |
select * from tweets t where t.geom && st_geomfromtext( | |
'POLYGON ((-99.5408690000000007 19.9525709999999989, -99.5435870000000023 19.9554469999999995, -99.3506809999999945 20.0420480000000012, -99.3361179999999990 20.0463349999999991, | |
-99.1990940000000023 20.2146280000000012, | |
-99.1924779999999942 20.2391210000000008, | |
-99.1860319999999973 20.2430979999999998, | |
-99.1860300000000024 20.2430990000000008, | |
-98.9455770000000001 20.2654850000000017, | |
-98.9449809999999985 20.2654619999999994, | |
-98.9423579999999987 20.2606110000000008, | |
-98.8173819999999949 20.1350939999999987, -98.7599189999999965 20.1261369999999999, -98.7324749999999938 20.1274310000000014, -98.5636429999999990 20.2358669999999989, -98.4145270000000068 20.0966829999999987, -98.7129479999999973 20.0652369999999998, -98.5766100000000023 19.7826479999999982, -98.5761750000000063 19.7703230000000012, -98.5397349999999932 19.6572999999999993, -98.6620520000000027 19.3520900000000005, | |
-98.4457770000000068 19.2840899999999991, -98.4346189999999979 19.2822309999999995, | |
-98.2354019999999934 19.3239739999999998, -98.1616429999999980 19.4128660000000011, -98.1343090000000018 19.4144460000000016, -98.0918669999999935 19.3971680000000006, -98.0918609999999944 19.3971629999999990, | |
-97.9260189999999966 19.3154579999999996, -97.9193980000000010 19.2864819999999995, -97.9509120000000024 19.1048819999999999, -97.7832700000000017 18.9754110000000011, -97.6708210000000037 18.9054600000000015, -97.6601730000000003 18.8695820000000012, -97.7745989999999949 18.8972039999999986, | |
-97.8743429999999961 18.9477949999999993, -97.9117080000000044 18.9663819999999994, -98.1358429999999942 18.9377150000000007, -98.2158660000000054 18.9624050000000004, -98.2721970000000056 18.9685050000000004, -98.4213950000000040 18.9183109999999992, -98.4403999999999968 18.9045750000000012, | |
-98.4482600000000048 18.9075600000000001, -98.6471559999999954 19.0870549999999994, -98.7742250000000013 19.0564280000000004, -98.7742329999999953 19.0564350000000005, -98.7742449999999934 19.0564500000000017, -98.9984199999999959 19.1746170000000014, -99.0301180000000016 19.1667379999999987, -99.1592480000000052 19.2084370000000000, -99.1626550000000009 19.2105120000000014, -99.4431320000000056 19.2108220000000003, -99.4692790000000002 19.1807419999999986, -99.5875779999999935 19.2145879999999991, -99.6365679999999969 19.2208089999999991, -99.6606840000000034 19.2208240000000004, -99.7200639999999936 19.2764659999999992, -99.7201539999999937 19.2768259999999998, | |
-99.7365439999999950 19.3249509999999987, -99.8381660000000011 19.5612279999999998, -99.6875979999999942 19.4100700000000010, -99.4030209999999954 19.5735080000000004, -99.4499820000000057 19.6884000000000015, -99.5408690000000007 19.9525709999999989))' | |
,4326) | |
select * from tweets t where st_intersects(t.geom, st_geomfromtext( | |
'POLYGON ((-99.5408690000000007 19.9525709999999989, -99.5435870000000023 19.9554469999999995, -99.3506809999999945 20.0420480000000012, -99.3361179999999990 20.0463349999999991, | |
-99.1990940000000023 20.2146280000000012, | |
-99.1924779999999942 20.2391210000000008, | |
-99.1860319999999973 20.2430979999999998, | |
-99.1860300000000024 20.2430990000000008, | |
-98.9455770000000001 20.2654850000000017, | |
-98.9449809999999985 20.2654619999999994, | |
-98.9423579999999987 20.2606110000000008, | |
-98.8173819999999949 20.1350939999999987, -98.7599189999999965 20.1261369999999999, -98.7324749999999938 20.1274310000000014, -98.5636429999999990 20.2358669999999989, -98.4145270000000068 20.0966829999999987, -98.7129479999999973 20.0652369999999998, -98.5766100000000023 19.7826479999999982, -98.5761750000000063 19.7703230000000012, -98.5397349999999932 19.6572999999999993, -98.6620520000000027 19.3520900000000005, | |
-98.4457770000000068 19.2840899999999991, -98.4346189999999979 19.2822309999999995, | |
-98.2354019999999934 19.3239739999999998, -98.1616429999999980 19.4128660000000011, -98.1343090000000018 19.4144460000000016, -98.0918669999999935 19.3971680000000006, -98.0918609999999944 19.3971629999999990, | |
-97.9260189999999966 19.3154579999999996, -97.9193980000000010 19.2864819999999995, -97.9509120000000024 19.1048819999999999, -97.7832700000000017 18.9754110000000011, -97.6708210000000037 18.9054600000000015, -97.6601730000000003 18.8695820000000012, -97.7745989999999949 18.8972039999999986, | |
-97.8743429999999961 18.9477949999999993, -97.9117080000000044 18.9663819999999994, -98.1358429999999942 18.9377150000000007, -98.2158660000000054 18.9624050000000004, -98.2721970000000056 18.9685050000000004, -98.4213950000000040 18.9183109999999992, -98.4403999999999968 18.9045750000000012, | |
-98.4482600000000048 18.9075600000000001, -98.6471559999999954 19.0870549999999994, -98.7742250000000013 19.0564280000000004, -98.7742329999999953 19.0564350000000005, -98.7742449999999934 19.0564500000000017, -98.9984199999999959 19.1746170000000014, -99.0301180000000016 19.1667379999999987, -99.1592480000000052 19.2084370000000000, -99.1626550000000009 19.2105120000000014, -99.4431320000000056 19.2108220000000003, -99.4692790000000002 19.1807419999999986, -99.5875779999999935 19.2145879999999991, -99.6365679999999969 19.2208089999999991, -99.6606840000000034 19.2208240000000004, -99.7200639999999936 19.2764659999999992, -99.7201539999999937 19.2768259999999998, | |
-99.7365439999999950 19.3249509999999987, -99.8381660000000011 19.5612279999999998, -99.6875979999999942 19.4100700000000010, -99.4030209999999954 19.5735080000000004, -99.4499820000000057 19.6884000000000015, -99.5408690000000007 19.9525709999999989))' | |
,4326)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment