Hi,
There was some discussion about how to handle features with no geometry.
Now I have a few shapefiles created with ogr2ogr from a database and
sometimes the geometry is missing. OpenJUMP opens these shapefiles OK
and attributes are listed fine. However, there is something odd in how
OJ treats these shapes.
Feature info or Copy selected items do not work. One of the tools gave
me this exception:
java.lang.NullPointerException
at
com.vividsolutions.jump.io.FUTURE_JTS_WKTWriter.createFormatter(FUTURE_J
TS_WKTWriter.java:46)
at
com.vividsolutions.jump.io.FUTURE_JTS_WKTWriter.writeFormatted(FUTURE_JT
S_WKTWriter.java:155)
at
com.vividsolutions.jump.io.FUTURE_JTS_WKTWriter.write(FUTURE_JTS_WKTWrit
er.java:92)
at
com.vividsolutions.jump.workbench.ui.plugin.InstallStandardFeatureTextWr
itersPlugIn$3.write(InstallStandardFeatureTextWritersPlugIn.java:53)
at
com.vividsolutions.jump.workbench.ui.GeometryInfoTab$FeatureInfoWriterAd
apter.toHTML(GeometryInfoTab.java:156)
at
com.vividsolutions.jump.workbench.ui.FeatureInfoWriter.append(FeatureInf
oWriter.java:171)
at
com.vividsolutions.jump.workbench.ui.FeatureInfoWriter.writeGeom(Feature
InfoWriter.java:141)
at
com.vividsolutions.jump.workbench.ui.GeometryInfoPanel.updateText(Geomet
ryInfoPanel.java:99)
at
com.vividsolutions.jump.workbench.ui.GeometryInfoPanel.layerAdded(Geomet
ryInfoPanel.java:86)
at
com.vividsolutions.jump.workbench.ui.InfoModel.add(InfoModel.java:88)
at
com.vividsolutions.jump.workbench.ui.plugin.FeatureInfoPlugIn.execute(Fe
atureInfoPlugIn.java:83)
at
com.vividsolutions.jump.workbench.ui.AttributeTab$14.execute(AttributeTa
b.java:427)
at
com.vividsolutions.jump.workbench.plugin.AbstractPlugIn$1.actionPerforme
d(AbstractPlugIn.java:130)
at javax.swing.AbstractButton.fireActionPerformed(Unknown
Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown
Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown
Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown
Source)
at
javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown
Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown
Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown
Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown
Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown
Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Another problem is that I cannot save data to shapefile due to geometry
type check:
com.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(Shapefil
eWriter.java:577)
at
com.vividsolutions.jump.io.ShapefileWriter.write(ShapefileWriter.java:25
2)
at
com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource$1.execu
teUpdate(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)
Extract layers by geometry type separates the points but not
null-geometries which seems to mean that there is no way to save the
features without geometry back to shapefiles. I wonder if null
geometries really should really be considered as an own geometry type or
if they could be accepted together with points, lines, polygons etc.
Who knows what shapefile specification says?
If I save the opened shapefile as Jump xml and reopen the data previous
things seem to work. I can copy the GEOMETRYCOLLECTION EMPTY feature to
a new layer etc. However, I noticed another issue: The attribute query
tool does not list the attributes of Jump xml file. Simple query tool
works OK.
-Jukka Rahkonen-
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Jump-pilot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel