[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [udig-devel] splitting line segment
|
Ok, got the problem.... but now I have a new one:
I get an exception of the type:
java.lang.NullPointerException
at
org.geotools.data.shapefile.ShapefileDataStore$Writer.write(ShapefileDataStore.java:1587)
at
org.geotools.data.shapefile.ShapefileDataStore$Writer.close(ShapefileDataStore.java:1463)
at
org.geotools.data.InProcessLockingManager$1.close(InProcessLockingManager.java:344)
at
org.geotools.data.AbstractFeatureStore.addFeatures(AbstractFeatureStore.java:232)
at
eu.hydrologis.jgrass.operation.splitlines.SplitLineOperation.op(SplitLineOperation.java:152)
at
net.refractions.udig.ui.operations.OpAction$RunJob.run(OpAction.java:180)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
Through debugging I notice that in the ShapefileDataStore the write
method finds a feature without geometry...
// writing of Geometry
Geometry g = currentFeature.getDefaultGeometry();
g after that line is null... which I can hardly believe...
Any Idea about what I could have done wrong?
Thanks,
Ciao
Andrea
Andrea Antonello - HydroloGIS probaly wrote:
> Ok, I get the proper arraylist of features (finalFeature) at the end:
>
> I create the collection:
>
> FeatureCollection fcollection = FeatureCollections.newCollection();
> for( int i = 0; i < finalFeature.size(); i++ ) {
> fcollection.add(finalFeature.get(i));
> }
>
> which I then write:
>
> FeatureStore store = (FeatureStore) ds.getFeatureSource();
> store.addFeatures(featureCollection);
>
> And get one single feature in my new created shapefile instead of a lot
> of single ones... :(
>
> What is going wrong?
>
> andrea
>
>
> Jody Garnett probaly wrote:
>> It is enough to duplicate the feature yes - when you add that feature to
>> the feature store it will get a new FeatureID and so on. In really fancy
>> editing systems (with workflows and so on) the features would remember
>> each other as part of an audit trail or something. Andrea is working on
>> some of that kind of magic right now for a versioning geoserver wfs-t;
>> we may be able to abuse the same backend for those wanting a serious
>> postgis editing workflow. Ah to dream :-)
>>
>> Jody
>>> Right, just trust the community :)
>>>
>>> One question to the udiggers.
>>> I want to leave the attributes the same as the ones of the original
>>> feature.
>>> Is it enough to duplicate the feature and set the new geometry as its
>>> default geometry?
>>>
>>> Andrea
>>>
>>
>
> _______________________________________________
> User-friendly Desktop Internet GIS (uDig)
> http://udig.refractions.net
> http://lists.refractions.net/mailman/listinfo/udig-devel
>