[udig-devel] adding and modifying a new feature

andrea antonello andrea.antonello at gmail.com
Tue May 6 08:17:01 PDT 2008


[...]
>  Ok, that makes sense.
>  But doing:
>
>
>                 UndoableMapCommand createAddFeatureCommand = EditCommandFactory
>                         .getInstance().createAddFeatureCommand(feature, layer);
>                 map.sendCommandASync(createAddFeatureCommand);
>                 // and put it inside the map
>                 Feature newFeatureAdded = ((AddFeatureCommand)
>  createAddFeatureCommand)
>                         .getNewFeature();
>
>  I get a:
>
>  java.lang.NullPointerException
>         at org.geotools.data.shapefile.indexed.IndexedFidReader.findFid(IndexedFidReader.java:132)
>         at org.geotools.data.shapefile.indexed.IndexedShapefileDataStore.queryFidIndex(IndexedShapefileDataStore.java:562)
>         at org.geotools.data.shapefile.indexed.IndexedShapefileDataStore.getAttributesReader(IndexedShapefileDataStore.java:465)
>         at org.geotools.data.shapefile.indexed.IndexedShapefileDataStore.getFeatureReader(IndexedShapefileDataStore.java:405)
>         at org.geotools.data.AbstractDataStore.getFeatureReader(AbstractDataStore.java:366)
>         at org.geotools.data.DefaultFeatureResults.reader(DefaultFeatureResults.java:147)
>         at org.geotools.data.store.DataFeatureCollection.openIterator(DataFeatureCollection.java:225)
>         at org.geotools.data.store.DataFeatureCollection.iterator(DataFeatureCollection.java:201)
>         at org.geotools.data.store.DataFeatureCollection.features(DataFeatureCollection.java:192)
>         at net.refractions.udig.project.internal.commands.edit.AddFeatureCommand.getNewFeature(Unknown
>  Source)

Hmmm, that is solved by sending the command in sync mode.

And the added features are shown... investigating further.
Andrea



>
>
>  > > My problem is that the added features are not visible, also if I do a
>  > > redraw, they do not appear, even if they are present in the table
>  > >
>  >
>  >  Does the feature that you first add have a full geometry.  IE isn't a
>  > singularity?
>
>  I create a full geometry, but I don't know what you mean by singularity.
>
>
>  > > Is this somehow related to the features sometimes not appearing while
>  > editing?
>  > >
>  >
>  >  entirely possible...  What datastore are you using for the editing?
>
>  Shapefile.
>
>  Thanks,
>  Andrea
>
>
>
>
>
>  >
>  >
>  >  _______________________________________________
>  >  User-friendly Desktop Internet GIS (uDig)
>  >  http://udig.refractions.net
>  >  http://lists.refractions.net/mailman/listinfo/udig-devel
>  >
>


More information about the udig-devel mailing list