Steve Horn | 26 Jun 2012 14:38
Gravatar

Simplifying Polygons

Hello!
Having a a client-side performance problem due to a large number of polygons being brought down to a Google Map. Sometimes the GZipped response is around 2MB worth of GeoJSON.


I'm hoping that I can partially solve the problem by simplifying the polygons using ST_Simplify. The problem I'm running into is that the polygons are all contiguous and after simplification they are not connecting with each other. (See attached image) 

Anyone know how I can simplify the polygons and keep them all "fitting together"?

--
Steve Horn

_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
Robert_Clift | 26 Jun 2012 14:44
Picon
Favicon

Re: Simplifying Polygons

Try ST_SimplifyPreserveTopology.
 
-Rob

From: postgis-users-bounces <at> postgis.refractions.net [mailto:postgis-users-bounces <at> postgis.refractions.net] On Behalf Of Steve Horn
Sent: Tuesday, June 26, 2012 8:39 AM
To: postgis-users <at> postgis.refractions.net
Subject: [postgis-users] Simplifying Polygons

Hello!
Having a a client-side performance problem due to a large number of polygons being brought down to a Google Map. Sometimes the GZipped response is around 2MB worth of GeoJSON.

I'm hoping that I can partially solve the problem by simplifying the polygons using ST_Simplify. The problem I'm running into is that the polygons are all contiguous and after simplification they are not connecting with each other. (See attached image) 

Anyone know how I can simplify the polygons and keep them all "fitting together"?

--
Steve Horn

_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
Francois Hugues | 26 Jun 2012 14:47
Picon
Favicon

Re: Simplifying Polygons

 

It preserves topology for a simple polygon but not for an entire layer

 

Hugues.

 

De : postgis-users-bounces <at> postgis.refractions.net [mailto:postgis-users-bounces <at> postgis.refractions.net] De la part de Robert_Clift <at> doh.state.fl.us
Envoyé : mardi 26 juin 2012 14:45
À : postgis-users <at> postgis.refractions.net
Objet : Re: [postgis-users] Simplifying Polygons

 

Try ST_SimplifyPreserveTopology.

 

-Rob

 

From: postgis-users-bounces <at> postgis.refractions.net [mailto:postgis-users-bounces <at> postgis.refractions.net] On Behalf Of Steve Horn
Sent: Tuesday, June 26, 20128:39 AM
To: postgis-users <at> postgis.refractions.net
Subject: [postgis-users] Simplifying Polygons

Hello!
Having a a client-side performance problem due to a large number of polygons being brought down to a Google Map. Sometimes the GZipped response is around 2MB worth of GeoJSON.

 

I'm hoping that I can partially solve the problem by simplifying the polygons using ST_Simplify. The problem I'm running into is that the polygons are all contiguous and after simplification they are not connecting with each other. (See attached image) 

 

Anyone know how I can simplify the polygons and keep them all "fitting together"?

 

--
Steve Horn

_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
Francois Hugues | 26 Jun 2012 14:45
Picon
Favicon

Re: Simplifying Polygons

Hello,

This is an ordinary problem and there are tow solution to solve it :
- a plpg function wrote by nicolas ribot : http://trac.osgeo.org/postgis/wiki/UsersWikiSimplifyPreserveTopology
- a function wrote by sandro santilli using the new topology functions of postgis 2 : http://strk.keybit.net/blog/2012/04/13/simplifying-a-map-layer-using-postgis-topology/
And also a related approach by Nicolas ribot : http://trac.osgeo.org/postgis/wiki/UsersWikiSimplifyWithTopologyExt

With all this stuff, you should manage to do what you want

Hugues.

________________________________________
De : postgis-users-bounces <at> postgis.refractions.net
[mailto:postgis-users-bounces <at> postgis.refractions.net] De la part de Steve Horn
Envoyé : mardi 26 juin 2012 14:39
À : postgis-users <at> postgis.refractions.net
Objet : [postgis-users] Simplifying Polygons

Hello!
Having a a client-side performance problem due to a large number of polygons being brought down to a Google
Map. Sometimes the GZipped response is around 2MB worth of GeoJSON.

I'm hoping that I can partially solve the problem by simplifying the polygons using ST_Simplify. The
problem I'm running into is that the polygons are all contiguous and after simplification they are not
connecting with each other. (See attached image) 

Anyone know how I can simplify the polygons and keep them all "fitting together"?

--

-- 
Steve Horn
Sandro Santilli | 26 Jun 2012 14:51
Gravatar

Re: Simplifying Polygons

On Tue, Jun 26, 2012 at 08:38:56AM -0400, Steve Horn wrote:

> Anyone know how I can simplify the polygons and keep them all "fitting
> together"?

http://trac.osgeo.org/postgis/wiki/UsersWikiSimplifyPreserveTopology

--strk;

 Sent from our free software
 http://www.gnu.org/philosophy/free-sw.html
Sean Christopher Conway | 27 Jun 2012 00:41
Favicon

Erase equivalent


Can somebody give me a rough query for the equivalent of an ArcGIS ERASE 
using two polygons. Cheers, Sean.
Bborie Park | 27 Jun 2012 01:07
Picon

Re: Erase equivalent

On 06/26/2012 03:41 PM, Sean Christopher Conway wrote:
> 
> Can somebody give me a rough query for the equivalent of an ArcGIS ERASE
> using two polygons. Cheers, Sean.
> _______________________________________________
> postgis-users mailing list
> postgis-users <at> postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 

No idea what exactly ERASE does but I'm guessing you'll be using some
combination of ST_Intersection and and ST_Difference.

-bborie

--

-- 
Bborie Park
Programmer
Center for Vectorborne Diseases
UC Davis
530-752-8380
bkpark <at> ucdavis.edu

Gmane