Hello Chris, thanks by your answer but I think I didn't explain myself
properly.

Currently the application is working property and I'm loading from MySQL the
polygons information and I'm showing its in Google Maps, but. I have
performance problems because I'm parsing with Javascript very long strings
and I need to know about a better way for doing it.

My actual procedure is:

-          MySQL table with Geometry field (spatial extension)

-          Query it, using AsText(geometry) function

-          Send it to javascript in json format

-          Parse the string and separate each polygon's node for creating an
array of LatLng

-          Using google.maps.Polyline 

Note:

I can't use Postgres and PostGIS in my server.  

 

Some suggestion?

 

 

De: Chris Broadfoot [mailto:[email protected]] 
Enviado el: lunes, 28 de febrero de 2011 2:24
Para: [email protected]
CC: Silver
Asunto: Re: [Google Maps API v3] Parsing Geometry MySQL's Field

 

Some of these may be of use...

 

https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/
indexOf

https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/
substring

https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/
split

https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/parseFl
oat

On Mon, Feb 28, 2011 at 6:18 PM, Silver <[email protected]> wrote:

Hello friends,
I have a MySQL table for storing polygons for each country's state.
---
idregion, int, autoincrement
region, varchar(50)
polygon: geometry
---

>From PHP I'm getting a json response with the polygon coordinates as
string:
"SELECT region, AsText(polygon) FROM regions"
Like this:
[{'region':'state 1','polygon':'POLYGON(5 3,8 4,5 5,2 9)'},
{'region':'state 2','polygon':'POLYGON(2 3,7 1,9 7,1 3)'},...]

Now, for showing the polygon using the Google Maps API I need to
remove the first portion of the string and parse the rest twice for
creating a LatLng set.

Can somebody suggest to me a best way for creating a polygon from a
GEOMETRY MySQL field?
Regards!!!!

--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected]
<mailto:google-maps-js-api-v3%[email protected]> .
For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.




-- 
http://twitter.com/broady

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to