[mapserver-users] gml_[item name]_precision for GeoJSON WFS
TC Haddad
tchaddad at gmail.com
Mon Mar 10 02:48:57 PDT 2014
Thank you, I had not set gml_ID_type "Real" - however setting:
"gml_ID_type" "Real"
"gml_ID_precision" "0"
still results in one decimal:
{
"type": "FeatureCollection",
"crs": { "type": "name", "properties": { "name":
"urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { "ID": "91.0", "NAME": "10th and
Neacoxie Avenue", "OWNER": "Gearhart, City of", "CTYPE": "Beach",
"ATYPE": "Vehicle" }, "geometry": { "type": "Point", "coordinates": [
-123.92739999997939, 46.030950000943108 ] } }]}
however your hint got me to a solution that skips precision altogether,
apologies for missing it before:
"gml_ID_type" "Integer"
results in:
{
"type": "FeatureCollection",
"crs": { "type": "name", "properties": { "name":
"urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { "ID": "91", "NAME": "10th and
Neacoxie Avenue", "OWNER": "Gearhart, City of", "CTYPE": "Beach",
"ATYPE": "Vehicle" }, "geometry": { "type": "Point", "coordinates": [
-123.92739999997939, 46.030950000943108 ] } }]}
many thanks!
On Mon, Mar 10, 2014 at 12:40 AM, Martin Kofahl <martin.kofahl at gmail.com>wrote:
Hello,
> did you set gml_ID_type "Real"?
>
> Kind regards, Martin
>
>
> 2014-03-10 5:35 GMT+01:00 TC Haddad <tchaddad at gmail.com>:
>
>>
>> Hello, I'm trying to use "gml_[item name]_precision" and having trouble.
>> I've tried:
>>
>> gml_ID_precision 0
>>
>> which fails with "getString(): Symbol definition error. Parsing error
>> near (0):(line 14)", and:
>>
>> gml_ID_precision "0"
>>
>> which succeeds in producing GeoJSON as expected but the setting seems to
>> be ignored, e.g.:
>>
>> {
>> "type": "FeatureCollection",
>> "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
>> "features": [
>> { "type": "Feature", "properties": { "ID": "91.00000", "NAME": "10th and Neacoxie Avenue", "OWNER": "Gearhart, City of", "CTYPE": "Beach", "ATYPE": "Vehicle" }, "geometry": { "type": "Point", "coordinates": [ -123.92739999997939, 46.030950000943108 ] } }]}
>>
>>
>> The docs say:
>>
>> *Precision is the number of decimal places, and is only needed for "Real"
>> fields*
>>
>> I'm not sure what "Real" fields mean, but I am trying to use it for the
>> ID field, so maybe that is why I am failing?
>>
>> I'm using Mapserver 6.2.1. with:
>>
>> OUTPUTFORMAT
>> NAME "GEOJSON"
>> DRIVER "OGR/GEOJSON"
>> MIMETYPE "application/json; subtype=geojson"
>> FORMATOPTION "STORAGE=stream"
>> FORMATOPTION "FORM=SIMPLE"
>> END
>>
>>
>>
>> _______________________________________________
>> mapserver-users mailing list
>> mapserver-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>
>
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20140310/1c38ce03/attachment.htm>
More information about the MapServer-users
mailing list