Have you checked the examples on
http://dev.mysql.com/doc/refman/5.1/en/geometry-pr operty-functions.html#Polygon-property-functions
?
It all comes down to
GeomFromText('Polygon((...))');
with ... being one or more closed loop LINESTRING definitions.
The examples on the page above use a MULTIPOLYGON consisting of two triangles:
'Polygon((0 0,0 3,3 0,0 0...
It may be of interest to people here, that Wikileaks have made available a database of post codes, latitude and longitude data.
http://wikileaks.org/wiki/UK_government_database_o f_all_1,841,177_post_codes_together_with_precise_g eographic_coordinates_and_other_information,_8_Jul _2009
According to Wikileaks:
The database, which is compiled at tax-payer expense, has long been the ...
Contains() is currently just an alias to MBRContains(), see the first note on
http://dev.mysql.com/doc/refman/5.1/en/functions-t hat-test-spatial-relationships-between-geometries. html
and the section on MBRContains(), which has a usage example, on
http://dev.mysql.com/doc/refman/5.1/en/relations-o n-geometry-mbr.html
If you are looking for an equivalent to the MS SQL ...
Hi All,
I'm working on the openlayers module for Drupal (drupal.org/project/openlayers). Defining a new spatial column's SRID, and adding data from a particular SRID is well documented. However, for the life of me I can't figure out how to pull the SRID out of an existing column.
Thanks!
Cheers,
Patrick Hayes
I was looking for a "point in polygon" function which doens't use simple MBR.
Finally I found a post from Adam Smith with a working MySQL stored function, based on the idea from http://local.wasp.uwa.edu.au/~pbourke/geometry/ins idepoly/
But, the function was too slow, so I optimized it a little bit.
If someone does have a better alternative or a faster MySQL stored function, please let...
Hi, I am interested in designing a Geocoded Location Cache. At present we perform a look up for every position from an external source which is proving to be extremely restrictive and costly.
All the locations are stored in the database as gpsPosition >> lat lng geocodedLocationId.
I was thinking of either using QuadTrees in java to build its own cache or indexing the latitude and ...
Hi, I am interested in designing a Geocoded Location Cache. At present we perform a look up for every position from an external source which is proving to be extremely restrictive and costly.
All the locations are stored in the database as gpsPosition >> lat lng geocodedLocationId.
I was thinking of either using QuadTrees in java to build its own cache or indexing the latitude and ...
listed in different place please see
http://forums.mysql.com/read.php?24,287034,287034# msg-287034
Hi, I am interested in designing a Geocoded Location Cache. At present we perform a look up for every position from an external source which is proving to be extremely restrictive and costly.
All the locations are stored in the database as gpsPosition >> lat lng geocodedLocationId....
Thanks Barry. Sorry to prolong this thread but if we look at this page: http://dev.mysql.com/doc/refman/4.1/en/functions-that-test-spatial-relationships-between-geometries.html (which happens to be the same for all MySql versions) where do they mark the version number where the functions were introduced/changed ? At: http://dev.mysql.com/doc/mysqld-version-reference/en/mysqld-version-reference-opsfuncs.html there is a list of functions. It...
Hi, I am interested in designing a Geocoded Location Cache. At present we perform a look up for every position from an external source which is proving to be extremely restrictive and costly. All the locations are stored in the database as gpsPosition >> lat lng geocodedLocationId. I was thinking of either using QuadTrees in java to build its own cache or indexing the latitude and longitudes in mysql. Note currently 40,000,000...
Hello The distance calculation between two points in can be done using GLength function as mentioned in the documentation. Eg:- SET @lat1 =40.756054, @lon1 = -73.986951, /** NEW YORK */ @lat2 =51.5001524, @lon2 = 0.1262362; /** London */ SELECT GLength(LineStringFromWKB(LineString(ASBINARY(GeomFromText(CONCAT('POINT(',@lat1,' ', @lon1,')'))) as Distance But the distance here calculated is not based on geo model....
When will the GIS improvements made in WL#1326 be released into the production code (5.4... 6.0...further out...)? We're using the 'test' code now, but are wondering if we should even use the new reliable functions in our product.
Dear friends, I have a bunch of polygons defined and I would like to find out which of them are under a StringLine. I tried with: 1# SELECT id, AsText(g) AS myPolygon FROM flst WHERE MBRIntersects(LineStringFromText('LINESTRING(4480611.9803 5551488.0621,4480804.8855 5551431.9080)'), g); -> The result isn’t good enough because there is being used the boundary(=Big rectangle) of the StringLine Even with the function...
Hi there: I ran a query on a table that has two columns of type POINT with spatial indexing being applied (using R+ tree). The total records in the table is 480,847,800. This is how the table is created. CREATE TABLE table1 ( column1 varchar(11) NOT NULL default '1-1-174-418', startPoint POINT NOT NULL, endPoint POINT NOT NULL, SPATIAL INDEX point1_index (point1) USING RTREE, SPATIAL INDEX point2_index (point2) USING RTREE )...
Within a function declare a variable... Within a function declare a variable "local" then its value in the function stays in the function. Example: blah () { local myvar=5 ; }
Published
about 19 hours ago
From
web
Thread profile page for "example function Polygon" on http://www.mysql.com.
This report page is a snippet summary view from a single thread "example function Polygon", located on the Message Board at http://www.mysql.com.
This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity