jumpinjackie / mapguide-rest

REST Extension for MapGuide Open Source
GNU Lesser General Public License v2.1
26 stars 14 forks source link

Problem with POST /library/{resourcePath}.FeatureSource/json #185

Closed AlenKelemen closed 6 years ago

AlenKelemen commented 6 years ago

It seems that REST always sets "GeometryType" to 0 regardless to setting in POST body JSON. For instance if I put JSON body like following:

{ "FeatureSourceParams": { "File": { "Provider": "OSGeo.SDF", "FileName": "BuildingOutlines-1" }, "SpatialContext": { "CoordinateSystem": "GEOGCS['WGS84 Lat/Long's, Degrees, -180 ==> +180',DATUM['D_WGS_1984',SPHEROID['World_Geodetic_System_of_1984',6378137,298.257222932867]],PRIMEM['Greenwich',0],UNIT['Degree',0.017453292519943295]]", "XYTolerance": 0, "ZTolerance": 0, "Name": "WGS84 Lat/Long's, Degre", "Description": "test" }, "FeatureSchema": { "ClassDefinition": [ { "PropertyDefinition": [ { "IsIdentity": true, "PropertyType": 100, "DataType": 7, "Nullable": false, "IsAutoGenerated": true, "ReadOnly": true, "Name": "Autogenerated_SDF_ID" }, { "IsIdentity": false, "PropertyType": 102, "DataType": 13, "Nullable": true, "IsAutoGenerated": false, "GeometryType": 1, "HasElevation": false, "ReadOnly": false, "Name": "SHPGEOM" } ], "DefaultGeometryPropertyName": "SHPGEOM", "Name": "BuildingOutlines-1", "Description": "test" } ], "Name": "SHP-Shema", "Description": "test" } } }

then resulting sdf have GeometryType 0 and not 1 (Point). In Maestro the error is: Value does not fall within the expected range. image Resulting sdf is attached... BuildingOutlines-1.zip

jumpinjackie commented 6 years ago

It's a model documentation bug. Use GeometryTypes (with an s)