[postgis-users] Postgis Simplify

strk at refractions.net strk at refractions.net
Wed Jul 27 02:48:14 PDT 2005


Christo, you are using two different versions of postgis:
0.9.1 on Windows and 1.1.0CVS on Gentoo.
If you want to help you need to provide a self-contained
test script showing the problem.

BTW, note that 20 is a *really* big number for a tolerance
in lat/long space.

--strk;

On Wed, Jul 27, 2005 at 11:39:53AM +0200, Christo Du Preez wrote:
> No I don't have a test case, the result on the Windows platform just 
> didn't look right to me.
> 
> Windows:
> 
> version:    PostgreSQL 8.0.3 on i686-pc-mingw32, compiled by GCC gcc.exe 
> (GCC) 3.4.2 (mingw-special)
> postgis_version:    0.9 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
> postgis_lib_version:    0.9.1
> postgis_geos_version:    2.1.1
> postgis_proj_version:    Rel. 4.4.9, 29 Oct 2004
> postgis_full_version:    POSTGIS="0.9.1" GEOS="2.1.1" PROJ="Rel. 4.4.9, 
> 29 Oct 2004" USE_STATS DBPROC="0.0.1" RELPROC="0.0.1"
> 
> Gentoo:
> 
> version:    PostgreSQL 8.0.2 on i686-pc-linux-gnu, compiled by GCC gcc 
> (GCC) 3.3.2 20031218 (Gentoo Linux 3.3.2-r5, propolice-3.3-7)
> postgis_version:    1.1 USE_GEOS=0 USE_PROJ=1 USE_STATS=1
> postgis_lib_version:    1.1.0CVS
> postgis_geos_version:    2.1.1
> postgis_proj_version:    Rel. 4.4.9, 29 Oct 2004
> postgis_full_version:    POSTGIS="1.1.0CVS" GEOS="2.1.1" PROJ="Rel. 
> 4.4.9, 29 Oct 2004" USE_STATS DBPROC="0.3.0" RELPROC="0.3.0"
> 
> At first I recieved an "NOTICE: IllegalArgumentException: Exponent out 
> of bounds" trying to run:
> 
>    SELECT 
> AsSVG(intersection(Simplify(the_geom,20),GeometryFromText('POLYGON((16 
> -38,33 -38,33 -21,16 -21,16 -38))',-1)),1,1) AS svg_geom
>    FROM province
>    WHERE the_geom && setSRID('BOX3D(16 -38, 33 -21)'::box3d,-1)
> 
> It was the intersection() function that caused the error for whatever 
> reason. Then I stripped the intersection() function and and noticed the 
> exponential format of the results on windows (only on rows 3, 6 and 9), 
> but the results on linux was lat/long wgs84. After further testing I 
> noticed using npoints() that some rows on the windows machine didn't 
> simplify as much as on the linux box. Again this was only on rows 3, 6 
> and 9. As you can see below.
> 
> windows:
> 
> 1:	25290,		39
> 2:	23978,		43
> 3:	25999,		22046
> 4:	4996,		19
> 5:	24679,		31
> 6:	50819,		43120
> 7:	31899,		71
> 8:	63292,		45
> 9:	84990,		70460
> 10:	12878,		15
> 11:	1047,		8
> 
> linux
> 
> 1:   	25290   	39
> 2:   	23978   	43
> 3:   	25999   	41
> 4:   	4996    	19
> 5:   	24679   	31
> 6:   	50819   	25
> 7:   	31899   	71
> 8:   	63292   	45
> 9:   	84990   	59
> 10: 	12878   	15
> 11: 	1047      	8
> 
> 
> strk at refractions.net wrote:
> 
> >Christo, please be specific about your problem.
> >Do you have a test case showing unexpected behaviour for
> >the simplify() function ?
> >Would you include postgis version information in the
> >file ?
> >
> >--strk;
> >
> >On Tue, Jul 26, 2005 at 09:27:44PM +0200, Christo Du Preez wrote:
> > 
> >
> >>I used another installation, this time Linux and did the same test.
> >>
> >>This time the result was different on rows 3, 6 and 9. More what I was 
> >>expecting in the first place.
> >>
> >>1:   25290 :  39
> >>2:   23978 :  43
> >>3:   25999 :  41
> >>4:   4996  :  19
> >>5:   24679  : 31
> >>6:   50819 :  25
> >>7:   31899 :  71
> >>8:   63292 :  45
> >>9:   84990 :  59
> >>10: 12878 :  15
> >>11: 1047   :   8
> >>
> >>In previous posts I also mentioned the exponential format that my result 
> >>was, doing a Simplify(). I have also noticed that the exponential format 
> >>was only on rows 3, 6 and 9. The rest of the results was lat/long wgs84, 
> >>as expected.
> >>
> >>Can someone please shed some light on this?
> >>
> >>
> >>strk at refractions.net wrote:
> >>
> >>   
> >>
> >>>Christo, nothing weird about it, not every shape contains redundand
> >>>informations.
> >>>
> >>>Consider a straight line defined by millions of intermediate points.
> >>>A simplify(geom, 0) would make it a 2 point line.
> >>>
> >>>If you google for Douglas-Peuker you'll get
> >>>lots of informations about the algorithm.
> >>>
> >>>--strk;
> >>>
> >>>On Mon, Jul 25, 2005 at 10:20:23PM +0200, Christo Du Preez wrote:
> >>>
> >>>
> >>>     
> >>>
> >>>>This is really weird.
> >>>>
> >>>>select npoints(the_geom), npoints(Simplify(the_geom, .1))
> >>>>       
> >>>>
> >>>>from province
> >>>     
> >>>
> >>>>results to:
> >>>>
> >>>>1:	25290,		39
> >>>>2:	23978,		43
> >>>>3:	25999,		22046
> >>>>4:	4996,		19
> >>>>5:	24679,		31
> >>>>6:	50819,		43120
> >>>>7:	31899,		71
> >>>>8:	63292,		45
> >>>>9:	84990,		70460
> >>>>10:	12878,		15
> >>>>11:	1047,		8
> >>>>
> >>>>The data is lat/long wgs84, what could cause rows 3,6 and 9 not to 
> >>>>simplify as much as the others?
> >>>>
> >>>>_______________________________________________
> >>>>postgis-users mailing list
> >>>>postgis-users at postgis.refractions.net
> >>>>http://postgis.refractions.net/mailman/listinfo/postgis-users
> >>>> 
> >>>>
> >>>>       
> >>>>
> >>>_______________________________________________
> >>>postgis-users mailing list
> >>>postgis-users at postgis.refractions.net
> >>>http://postgis.refractions.net/mailman/listinfo/postgis-users
> >>>
> >>>
> >>>
> >>>
> >>>     
> >>>
> >>-- 
> >>Kind Regards,
> >>Christo Du Preez
> >>
> >>Senior Software Engineer
> >>Mecola IT
> >>http://www.mecola.com
> >>+27 [0]82 4255 895
> >>
> >>_______________________________________________
> >>postgis-users mailing list
> >>postgis-users at postgis.refractions.net
> >>http://postgis.refractions.net/mailman/listinfo/postgis-users
> >>   
> >>
> >_______________________________________________
> >postgis-users mailing list
> >postgis-users at postgis.refractions.net
> >http://postgis.refractions.net/mailman/listinfo/postgis-users
> >
> >
> > 
> >
> 
> -- 
> Kind Regards,
> Christo Du Preez
> 
> Senior Software Engineer
> Mecola IT
> http://www.mecola.com
> +27 [0]82 4255 895
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users



More information about the postgis-users mailing list