Hi,

I tried to do the following with spatialite-gui v. 1.5.0 and 1.6.0 which 
contain Spatialite v. 3.0 and 4.0, respectively.

select asbinary(geomfromtext('MULTIPOLYGON(((0 0, 10 20, 30 40, 0 0), (1 1, 2 
2, 3 3, 1 1)),
 ((100 100, 110 110, 120 120, 100 100)))
'))

I saved the returned binary code into disk and both versions seem to give gives 
those different bytes as 00 01 03, that is, similarly to PostGIS. But you do 
not use select as binary but you convert the Spatialite BLOBs into WKB with 
your code, doesn't you?  Perhaps there is something to check with the 
Spatialite BLOB document http://www.gaia-gis.it/gaia-sins/BLOB-Geometry.html.

The whole WKB in attachment.

-Jukka-



________________________________
Lähettäjä: Larry Reeder [lnree...@gmail.com]
Lähetetty: 15. huhtikuuta 2013 6:51
Vastaanottaja: OpenJump develop and use
Aihe: Re: [JPP-Devel] Spatialite multigeometry trouble and JTS v. 1.13




On Sun, Apr 14, 2013 at 3:39 PM, Rahkonen Jukka 
<jukka.rahko...@mmmtike.fi<mailto:jukka.rahko...@mmmtike.fi>> wrote:
Hi,

I made two tests:
1) With PostGIS 2.1
select encode(ST_AsBinary(ST_GeomFromText('MULTIPOLYGON(((0 0, 10 20, 30 40, 0 
0), (1 1, 2 2, 3 3, 1 1)),
 ((100 100, 110 110, 120 120, 100 100)))')), 'hex')
Query gives the same WKB that you used in JTS bug #3610843, that is
"0106000000020000000103000000020000000400000000000000000000000000000000000000000000000000244000000000000034400000000000003e4000000000000044400000000000000000000000000000000004000000000000000000f03f000000000000f03f0000000000000040000000000000004000000000000008400000000000000840000000000000f03f000000000000f03f01030000000100000004000000000000000000594000000000000059400000000000805b400000000000805b400000000000005e400000000000005e4000000000000059400000000000005940"

2) With Spatialite
select 
GeomFromWKB(x'0106000000020000006903000000020000000400000000000000000000000000000000000000000000000000244000000000000034400000000000003E4000000000000044400000000000000000000000000000000004000000000000000000F03F000000000000F03F0000000000000040000000000000004000000000000008400000000000000840000000000000F03F000000000000F03F69030000000100000004000000000000000000594000000000000059400000000000805B400000000000805B400000000000005E400000000000005E4000000000000059400000000000005940')
Query creates a multipolygon geometry.


Jukka,  these two WKB hex strings differ around the 20th character:

01060000000200000001030
01060000000200000069030

The second one is the one I retrieved from spatialite.   When I try to parse 
the second one with Postgis (1.5.3), I get an error:

select 
ST_GeomFromWkb(decode('0106000000020000006903000000020000000400000000000000000000000000000000000000000000000000244000000000000034400000000000003E4000000000000044400000000000000000000000000000000004000000000000000000F03F000000000000F03F0000000000000040000000000000004000000000000008400000000000000840000000000000F03F000000000000F03F69030000000100000004000000000000000000594000000000000059400000000000805B400000000000805B400000000000005E400000000000005E4000000000000059400000000000005940',
 'hex'));
ERROR:  invalid WKB type
HINT:  You must specify a valid OGC WKT geometry type such as POINT, LINESTRING 
or POLYGON

I haven't manually verified the WKB, but it might be that spatialite is 
generating an invalid WKB, and JTS 1.12 was more forgiving about it than 1.13 
is.

  -lreeder



Therefore it looks like the WKB is ok. But I do not understand that if PostGIS 
gives exactly the same WKB, how it is possible that OpenJUMP works with PostGIS 
but not with Spatialite through DB Query plugin?

-Jukka Rahkonen-



Attachment: spg15bin
Description: spg15bin

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to