I'm not even sure what to do about the Shapefile I/O problem, which I just read at the end of Jukka's e-mail.
It seems that supporting null/empty geometries is a little more difficult than we anticipated. Landon On Fri, Mar 19, 2010 at 12:33 PM, Sunburned Surveyor <[email protected]> wrote: > Jukka, > > Based on the stack trace you printed it looks like the Feature Info > plug-in and the Copy Selected Items write the geometry of the subject > features to WKT. Obviously the plug-ins are going to choke if they run > across a null geometry. > > You might be able to modify the plug-ins to ignore the null geometries. > > Does anyone else have comments or suggestions? > > The Sunburned Surveyor > > On Wed, Mar 10, 2010 at 7:25 AM, Rahkonen Jukka > <[email protected]> wrote: >> 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_JTS_WKTWriter.java:46) >> at >> com.vividsolutions.jump.io.FUTURE_JTS_WKTWriter.writeFormatted(FUTURE_JTS_WKTWriter.java:155) >> at >> com.vividsolutions.jump.io.FUTURE_JTS_WKTWriter.write(FUTURE_JTS_WKTWriter.java:92) >> at >> com.vividsolutions.jump.workbench.ui.plugin.InstallStandardFeatureTextWritersPlugIn$3.write(InstallStandardFeatureTextWritersPlugIn.java:53) >> at >> com.vividsolutions.jump.workbench.ui.GeometryInfoTab$FeatureInfoWriterAdapter.toHTML(GeometryInfoTab.java:156) >> at >> com.vividsolutions.jump.workbench.ui.FeatureInfoWriter.append(FeatureInfoWriter.java:171) >> at >> com.vividsolutions.jump.workbench.ui.FeatureInfoWriter.writeGeom(FeatureInfoWriter.java:141) >> at >> com.vividsolutions.jump.workbench.ui.GeometryInfoPanel.updateText(GeometryInfoPanel.java:99) >> at >> com.vividsolutions.jump.workbench.ui.GeometryInfoPanel.layerAdded(GeometryInfoPanel.java:86) >> at >> com.vividsolutions.jump.workbench.ui.InfoModel.add(InfoModel.java:88) >> at >> com.vividsolutions.jump.workbench.ui.plugin.FeatureInfoPlugIn.execute(FeatureInfoPlugIn.java:83) >> at >> com.vividsolutions.jump.workbench.ui.AttributeTab$14.execute(AttributeTab.java:427) >> at >> com.vividsolutions.jump.workbench.plugin.AbstractPlugIn$1.actionPerformed(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(ShapefileWriter.java:577) >> at >> com.vividsolutions.jump.io.ShapefileWriter.write(ShapefileWriter.java:252) >> 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) >> >> 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 >> >> > ------------------------------------------------------------------------------ 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
