Postgis Polygon to Google Maps Polygon

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Postgis Polygon to Google Maps Polygon

Jeremy Hageman
Hi all,

What is the most efficient way to load a group of postgis polygons into a google map api for display? It's possible to just iterate through all of the point in the polygon's boundary data to draw the regions, but this doesn't seem very efficient. Would it be better to utilize the ST_AsKML or ST_AsSVG functions and dynamically stitch together a KML or SVG file to be loaded? Or some other method?

-Jeremy H

_______________________________________________
postgis-users mailing list
[hidden email]
http://postgis.refractions.net/mailman/listinfo/postgis-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Postgis Polygon to Google Maps Polygon

Bborie Park


On 02/14/2012 03:43 PM, Jeremy Hageman wrote:

> Hi all,
>
> What is the most efficient way to load a group of postgis polygons into a
> google map api for display? It's possible to just iterate through all of
> the point in the polygon's boundary data to draw the regions, but this
> doesn't seem very efficient. Would it be better to utilize the ST_AsKML or
> ST_AsSVG functions and dynamically stitch together a KML or SVG file to be
> loaded? Or some other method?
>
> -Jeremy H

For Google Maps, the most efficient method I've found is to use encoded
polygons instead of using ST_AsKML or ST_AsSVG.  The link below provides
more than enough information about the encoding...

http://facstaff.unca.edu/mcmcclur/GoogleMaps/EncodePolyline/

For polygons with lots of vertices or complexity, I cache the encoding
polygons as the polygons usually don't change much over time.

-bborie

--
Bborie Park
Programmer
Center for Vectorborne Diseases
UC Davis
530-752-8380
[hidden email]
_______________________________________________
postgis-users mailing list
[hidden email]
http://postgis.refractions.net/mailman/listinfo/postgis-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Postgis Polygon to Google Maps Polygon

juancotrina
This post has NOT been accepted by the mailing list yet.
 Hi everybody:
I want to export a polygon from postgis with lots of vertice to kml using FUNCTION st_askml, but no export all poinst. How I can solve this problem?, Thanks to help me.

Juan Cotrina.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Postgis Polygon to Google Maps Polygon

juancotrina
In reply to this post by Bborie Park
 Hi everybody:
I want to export a polygon from postgis with lots of vertice to kml using FUNCTION st_askml, but no export all points. How can I solve this problem?, Thanks to help me.

Juan Cotrina.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Postgis Polygon to Google Maps Polygon

Tom van Tilburg-2
Hi Juan,

I'm not sure I understand your question. Do you mean that you want to simplify the polygon so it has less points? In that case, use ST_Simplify before your ST_AsKml function.
Read more about it over here: https://postgis.net/docs/ST_Simplify.html

Best,
 Tom

On Thu, Jun 1, 2017 at 9:50 PM, juancotrina <[hidden email]> wrote:
 Hi everybody:
I want to export a polygon from postgis with lots of vertice to kml using
FUNCTION st_askml, but no export all points. How can I solve this problem?,
Thanks to help me.

Juan Cotrina.



--
View this message in context: http://postgis.17.x6.nabble.com/Postgis-Polygon-to-Google-Maps-Polygon-tp4470594p5011238.html
Sent from the PostGIS - User mailing list archive at Nabble.com.
_______________________________________________
postgis-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-users


_______________________________________________
postgis-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Postgis Polygon to Google Maps Polygon

juancotrina
Hi Tom for yor answer. I don't want to simplify any polygon. My porpose is export all vertice from spatial table (postgis) to kml, but using ST_AsKml only export some points, therefore it does not allow drawing the polygon completely into Google Earh.
I using Postgis 1.3.5.

Juan


On Thu, Jun 1, 2017 at 2:55 PM, Tom van Tilburg-2 [via PostGIS] <[hidden email]> wrote:
Hi Juan,

I'm not sure I understand your question. Do you mean that you want to simplify the polygon so it has less points? In that case, use ST_Simplify before your ST_AsKml function.
Read more about it over here: https://postgis.net/docs/ST_Simplify.html

Best,
 Tom

On Thu, Jun 1, 2017 at 9:50 PM, juancotrina <[hidden email]> wrote:
 Hi everybody:
I want to export a polygon from postgis with lots of vertice to kml using
FUNCTION st_askml, but no export all points. How can I solve this problem?,
Thanks to help me.

Juan Cotrina.



--
View this message in context: http://postgis.17.x6.nabble.com/Postgis-Polygon-to-Google-Maps-Polygon-tp4470594p5011238.html
Sent from the PostGIS - User mailing list archive at Nabble.com.
_______________________________________________
postgis-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-users


_______________________________________________
postgis-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-users


If you reply to this email, your message will be added to the discussion below:
http://postgis.17.x6.nabble.com/Postgis-Polygon-to-Google-Maps-Polygon-tp4470594p5011239.html
To unsubscribe from Postgis Polygon to Google Maps Polygon, click here.
NAML

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Postgis Polygon to Google Maps Polygon

Stephen Woodbridge
Does this sound like your problem:
https://gis.stackexchange.com/questions/97966/invalid-kml-representation-on-st-geomfromkml

Also look here:
https://trac.osgeo.org/postgis/search?q=kml&noquickjump=1&ticket=on

Can you try using a new version of Postgis?

Or try posting the how output of something like:

select geom from mytable where gid=<geom_that_fails>;

And someone here can try it on 2.x version for you.

-Steve

On 6/1/2017 6:14 PM, juancotrina wrote:

> Hi Tom for yor answer. I don't want to simplify any polygon. My porpose
> is export all vertice from spatial table (postgis) to kml, but using
> ST_AsKml only export some points, therefore it does not allow drawing
> the polygon completely into Google Earh.
> I using Postgis 1.3.5.
>
> Juan
>
>
> On Thu, Jun 1, 2017 at 2:55 PM, Tom van Tilburg-2 [via PostGIS] <[hidden
> email] </user/SendEmail.jtp?type=node&node=5011240&i=0>> wrote:
>
>     Hi Juan,
>
>     I'm not sure I understand your question. Do you mean that you want
>     to simplify the polygon so it has less points? In that case, use
>     ST_Simplify before your ST_AsKml function.
>     Read more about it over here:
>     https://postgis.net/docs/ST_Simplify.html
>     <https://postgis.net/docs/ST_Simplify.html>
>
>     Best,
>       Tom
>
>     On Thu, Jun 1, 2017 at 9:50 PM, juancotrina <[hidden email]
>     <http:///user/SendEmail.jtp?type=node&node=5011239&i=0>> wrote:
>
>           Hi everybody:
>         I want to export a polygon from postgis with lots of vertice to
>         kml using
>         FUNCTION st_askml, but no export all points. How can I solve
>         this problem?,
>         Thanks to help me.
>
>         Juan Cotrina.
>
>
>
>         --
>         View this message in context:
>         http://postgis.17.x6.nabble.com/Postgis-Polygon-to-Google-Maps-Polygon-tp4470594p5011238.html
>         <http://postgis.17.x6.nabble.com/Postgis-Polygon-to-Google-Maps-Polygon-tp4470594p5011238.html>
>         Sent from the PostGIS - User mailing list archive at Nabble.com.
>         _______________________________________________
>         postgis-users mailing list
>         [hidden email]
>         <http:///user/SendEmail.jtp?type=node&node=5011239&i=1>
>         https://lists.osgeo.org/mailman/listinfo/postgis-users
>         <https://lists.osgeo.org/mailman/listinfo/postgis-users>
>
>
>
>     _______________________________________________
>     postgis-users mailing list
>     [hidden email] <http:///user/SendEmail.jtp?type=node&node=5011239&i=2>
>     https://lists.osgeo.org/mailman/listinfo/postgis-users
>     <https://lists.osgeo.org/mailman/listinfo/postgis-users>
>
>     ------------------------------------------------------------------------
>     If you reply to this email, your message will be added to the
>     discussion below:
>     http://postgis.17.x6.nabble.com/Postgis-Polygon-to-Google-Maps-Polygon-tp4470594p5011239.html
>     <http://postgis.17.x6.nabble.com/Postgis-Polygon-to-Google-Maps-Polygon-tp4470594p5011239.html>
>
>     To unsubscribe from Postgis Polygon to Google Maps Polygon, click here.
>     NAML
>     <http://postgis.17.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
>
>
>
> ------------------------------------------------------------------------
> View this message in context: Re: Postgis Polygon to Google Maps Polygon
> <http://postgis.17.x6.nabble.com/Postgis-Polygon-to-Google-Maps-Polygon-tp4470594p5011240.html>
> Sent from the PostGIS - User mailing list archive
> <http://postgis.17.x6.nabble.com/PostGIS-User-f3516033.html> at Nabble.com.
>
>
> _______________________________________________
> postgis-users mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/postgis-users
>


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

_______________________________________________
postgis-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Postgis Polygon to Google Maps Polygon

Tom van Tilburg-2
In reply to this post by juancotrina
Hi Juan,

You are using a *very* old version of postgis. There will be few people that can help you with bugs on this version so I recommend you try to get a higher version postgis first. It is not too difficult to install on your own computer and there are installations for all kinds of operating system.

Best, Tom

On Fri, Jun 2, 2017 at 12:14 AM, juancotrina <[hidden email]> wrote:
Hi Tom for yor answer. I don't want to simplify any polygon. My porpose is export all vertice from spatial table (postgis) to kml, but using ST_AsKml only export some points, therefore it does not allow drawing the polygon completely into Google Earh.
I using Postgis 1.3.5.

Juan


On Thu, Jun 1, 2017 at 2:55 PM, Tom van Tilburg-2 [via PostGIS] <[hidden email]> wrote:
Hi Juan,

I'm not sure I understand your question. Do you mean that you want to simplify the polygon so it has less points? In that case, use ST_Simplify before your ST_AsKml function.
Read more about it over here: https://postgis.net/docs/ST_Simplify.html

Best,
 Tom

On Thu, Jun 1, 2017 at 9:50 PM, juancotrina <[hidden email]> wrote:
 Hi everybody:
I want to export a polygon from postgis with lots of vertice to kml using
FUNCTION st_askml, but no export all points. How can I solve this problem?,
Thanks to help me.

Juan Cotrina.



--
View this message in context: http://postgis.17.x6.nabble.com/Postgis-Polygon-to-Google-Maps-Polygon-tp4470594p5011238.html
Sent from the PostGIS - User mailing list archive at Nabble.com.
_______________________________________________
postgis-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-users


_______________________________________________
postgis-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-users


If you reply to this email, your message will be added to the discussion below:
http://postgis.17.x6.nabble.com/Postgis-Polygon-to-Google-Maps-Polygon-tp4470594p5011239.html
To unsubscribe from Postgis Polygon to Google Maps Polygon, click here.
NAML



View this message in context: Re: Postgis Polygon to Google Maps Polygon
Sent from the PostGIS - User mailing list archive at Nabble.com.

_______________________________________________
postgis-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-users


_______________________________________________
postgis-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-users
Loading...