Sorry Michaël, I noticed that I used the version of OpenJUMP with a hacked JTS 
instead of the version with patched spatialite driver (r4823). My observations 
below are useless.

-Jukka-

Lähettäjä: Rahkonen Jukka (MML) [mailto:[email protected]]
Lähetetty: 17. helmikuuta 2016 17:34
Vastaanottaja: OpenJump develop and use
Aihe: Re: [JPP-Devel] OJ reads XYZ in PostGIS style EWKB, not in OGC style WKB

Hi Michaël,

Here is a test database that should contain one feature of each geometrytype 
which are valid in GeoPackage:
http://latuviitta.org/downloads/gpkg_geometrytype_test.gpkg

Just the byte order that comes from my Windows/Intel, unfortunately. You can 
create the same database with SQL script 
http://latuviitta.org/downloads/make_gpkg.txt but it requires  mod_spatialite 
with all the dependencies. Script can also be run from the SQL window of 
spatialite-gui but it may also help to just have a look at the script with bare 
eyes because all the geometries which are written into GeoPackage are there as 
WKT.

I had time for only a quick test. To start testing was by the way amazingly 
easy because with the new Spatialite datastore I could select all the layers at 
the same time and open them into an OJ project.

Geometries with Z seem to be mostly readable except GEOMETRYCOLLECTION Z. It 
looks like most or all ZM geometries behave badly.

-Jukka-

Lähettäjä: Michaël Michaud [mailto:[email protected]]
Lähetetty: 17. helmikuuta 2016 14:48
Vastaanottaja: 
[email protected]<mailto:[email protected]>
Aihe: Re: [JPP-Devel] OJ reads XYZ in PostGIS style EWKB, not in OGC style WKB

Hi Jukke,

Just patched spatialite driver in OpenJUMP.
Can you try different geometry types, and if possible, with different byte 
order ?
Not sure what happens wih geometry M and geometry ZM.

Michaël
Le 16/02/2016 13:40, Rahkonen Jukka (MML) a écrit :
Hi,

I can confirm that with the patched jts jar I can read XYZ geometries from 
GeoPackage database. Points, lines, and polygons tested. It would be very nice 
to get even a patched temporary read-only support for OGC style XYZ geometries 
into OpenJUMP soon without a need to wait until JTS will support them.

-Jukka Rahkonen-


Michaël Michaud wrote:

Thanks Jukka,

I was not aware of this difference between postgis wkb and ogc wkb.
Now, it is clear why I've never had problem with postgis 3D wkb and why there 
is problem with geopackage driver.

We'll have to make some suggestion to MD for JTS, but we have some options 
there.
JTS can manage 2D coordinates (very well), 3D coordinates (just holding 
information), and even 4D geometries (poorly = 4th dimension is generally lost 
after geometry processing)
JTS has not clear semantic for Z, M, ZM.

In the attached prototype, I made the simplest patch I could do :
if geometry type is > 1000, consider it is a 3D geometry (may be buggy for 
geometryZM which is 4D)
another option would be :
if geometry type is > 1000 and < 2000, consider it is a 3D geometry and throw 
an error over 2000

For wkb writer, it is another problem as we cannot write postgis wkb AND ogc 
wkb at the same time.
We'll have to add an option to the writer. We have to discuss that with MD.

Please, let me know if the attached proto resolve the problem (you have to add 
.jar and drop it in /lib folder in replacement of jts-1.14.0.jar).

As official JTS-1.14 has just been released and 1.15 is probably far ahead, we 
can also circumvent the problem by changing the wkb byte array in the 
geopackage reader so that it conforms to postgis wkb. It would need to extract 
and transform the four geometry type bytes. Not too difficult, but a bit 
convoluted

Michaël

Le 11/02/2016 11:26, Rahkonen Jukka (MML) a écrit :
Hi,

Pasting this thread 
https://lists.osgeo.org/pipermail/geos-devel/2013-December/006757.html for 
making it easier to find from the OpenJUMP archives what is the difference 
between XYZ  geometries as they appear in OGC WKT and in the PostGIS EWKB. 
Adding also some keywords from the original error:
unknown wkb type 235

It seems that the fix requires enhancement to JTS WKBReader/Writer for making 
it possible to the OGC style XYZ, XYM, and XYZM WKB.



Quotation from JTS 1.14 source file 
https://sourceforge.net/p/jts-topo-suite/code/HEAD/tree/trunk/jts/java/src/com/vividsolutions/jts/io/WKBWriter.java

* This implementation also supports the <b>Extended WKB</b>
 * standard. Extended WKB allows writing 3-dimensional coordinates
* and including the geometry SRID value.
 * The presence of 3D coordinates is signified
* by setting the high bit of the <tt>wkbType</tt> word.
* The presence of an SRID is signified
 * by setting the third bit of the <tt>wkbType</tt> word.
* EWKB format is upward compatible with the original SFS WKB format.

If you will write to JTS list you could perhaps suggest to at least add here 
and there in the code and javadocs a clear notice telling that only 2D OGC WKB 
is supported.

-Jukka Rahkonen-




------------------------------------------------------------------------------

Site24x7 APM Insight: Get Deep Visibility into Application Performance

APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month

Monitor end-to-end web transactions and take corrective actions now

Troubleshoot faster and improve end-user experience. Signup Now!

http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140




_______________________________________________

Jump-pilot-devel mailing list

[email protected]<mailto:[email protected]>

https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel




------------------------------------------------------------------------------

Site24x7 APM Insight: Get Deep Visibility into Application Performance

APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month

Monitor end-to-end web transactions and take corrective actions now

Troubleshoot faster and improve end-user experience. Signup Now!

http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140



_______________________________________________

Jump-pilot-devel mailing list

[email protected]<mailto:[email protected]>

https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Jump-pilot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to