Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 8.0-RC1
-
Fix Version/s: 2.7.5
-
Component/s: None
-
Labels:None
Description
The time devoted to explaining the method for encoding / decoding a feature from a String is a bit off topic; and now that we have two PropertyDataStore implementations I am going to refactor this common functionality out.
DataUtilities already has the following methods to support PropertyDataStore:
- DataUtilities.createType( String, String )
- DataUtilities.createType( String, String, String )
- DataUtilities.spec( FeatureType )
The goal is to end up with:
- DataUtilities.createType( String, String )
- DataUtilities.createType( String, String, String )
- DataUtilities.encodeType( SimpleFeatureType )
- DataUtilities.createFeature( SimpleFeatureType, String )
- DataUtilities.encodeFeature( SimpleFeature )
To review the format we are going for is:
SimpleFeatureType featureType = DataUtilities.createType("Contact","id:Integer,party:String,geom:Geometry:srid=4326"); SimpleFeature feature1 = DataUtilities.createFeature( featureType, "fid1=1|Jody Garnett\\nSteering Committee|POINT (1 2)" ); SimpleFeature feature2 = DataUtilities.createFeature( featureType, "2|John Hudson\\|Hapless Victim|POINT (6 2)" ); String spec = DataUtilities.encodeType(featureType); String text = DataUtilities.encodeFeature(feature1);