Hi,
Thanks. I'll wait for a new nightly build and once it is available I will test
saving with some odd geometry combinations.
-Jukka-
________________________________
Lähettäjä: Michaël Michaud [mailto:michael.mich...@free.fr]
Lähetetty: 10. lokakuuta 2010 18:29
Vastaanottaja: OpenJump develop and use
Aihe: Re: [JPP-Devel] Saving a layer with empty geometries into
shapefiles
Hi Jukka,
I just improved empty geometry handling in OJ shapefile driver.
Hope it will solve your problem. I had to do many modifications in the
code. I made extensive tests to make sure the code is as robust as before, but
I would be pleased if you could complete with your own tests.
Michaël
Le 07/10/2010 12:31, Rahkonen Jukka a écrit :
Hi,
JUMP DB Query plugin http://jumpdbqplugin.sourceforge.net/ used
to create a little polygon as a fake geometry for all the lines which the SQL
query was returning without a geometry. Now the new versions of the plugin,
starting from version 0.7.2. are creating an empty geometry as
"GEOMETRYCOLLECTION EMPTY".
This works fine as long as I am working with OpenJUMP and also
saving into JUMP jml format goes OK. But saving into shapefiles gives problems
and I have not discovered how I could keep the important attribute data that I
have also for the features without geometry.
If there are no other geometries on the layer, the OJ message
while doing shapefile save is
java.lang.Exception: Could not determine shapefile type - data
is either all GeometryCollections or empty
at
com.vividsolutions.jump.io.ShapefileWriter.makeSHAPEGeometryCollection(ShapefileWriter.java:728)
at
com.vividsolutions.jump.io.ShapefileWriter.write(ShapefileWriter.java:295)
at
com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource$1.executeUpdate(ReaderWriterFileDataSource.java:72)
at
com.vividsolutions.jump.workbench.datasource.AbstractSaveDatasetAsPlugIn.run(AbstractSaveDatasetAsPlugIn.java:33)
at
com.vividsolutions.jump.workbench.ui.task.TaskMonitorManager$TaskWrapper.run(TaskMonitorManager.java:151)
at java.lang.Thread.run(Unknown Source)
If there are also real geometries then the message is
om.vividsolutions.jump.io.IllegalParametersException: mixed
geometry types found, please separate Polygons from Lines and Points when
saving to *.shp
at
com.vividsolutions.jump.io.ShapefileWriter.checkIfGeomsAreMixed(ShapefileWriter.java:639)
at
com.vividsolutions.jump.io.ShapefileWriter.write(ShapefileWriter.java:253)
at
com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource$1.executeUpdate(ReaderWriterFileDataSource.java:72)
at
com.vividsolutions.jump.workbench.datasource.AbstractSaveDatasetAsPlugIn.run(AbstractSaveDatasetAsPlugIn.java:33)
at
com.vividsolutions.jump.workbench.ui.task.TaskMonitorManager$TaskWrapper.run(TaskMonitorManager.java:151)
at java.lang.Thread.run(Unknown Source)
Is it possible to save things without geometries into
shapefiles at all? It is easy to generate test data, just create a new layer
and insert a new WKT feature as GEOMETRYCOLLECTION EMPTY and try to save the
layer. Next digitise a point, for example, on the layer, and try saving again.
-Jukka Rahkonen-
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 &
L3.
Spend less time writing and rewriting code and more time
creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel