[MapServer-users] Format of numeric query results in GML

Lime, Steve D (MNIT) steve.lime at state.mn.us
Sat Dec 17 07:32:35 PST 2022


Hi Tanya: You might want to try using an OGR output format (https://mapserver.org/output/ogr_output.html#ogr-output). It supports GML as well and should provide a little more control and does respect the precision metadata.

--Steve

From: MapServer-users <mapserver-users-bounces at lists.osgeo.org> On Behalf Of TC Haddad
Sent: Friday, December 16, 2022 4:12 PM
To: Mapserver <mapserver-users at lists.osgeo.org>
Subject: [MapServer-users] Format of numeric query results in GML

Hi all,

I have a MapServer WMS that is returning GML query results, and all works well except that non-integer numeric fields are returning in scientific notation, eg.:

<USER>4.86010000000e+02</USER>
<USAGE>1100</USAGE>
<LATITUDE>3.58893542070e+01</LATITUDE>
<LONGITUDE>-1.20962789560e+02</LONGITUDE>
<SIZE>7.50000000000e-01</SIZE>

I see there is a metadata setting "gml_[item name]_precision" [1] that should allow specifying precision of these fields, but it seems it is not intended for GML output. Is this correct?

For example I tried setting this for the SIZE field:

'gml_SIZE_type' 'Real'
'gml_SIZE_precision' '2'

but this had no effect on the GML output:

<SIZE>7.50000000000e-01</SIZE>

Is there another way that I can accomplish better output from this service? The source data format is a shapefile, and unlikely to change in this case.

thanks for any suggestions,

Tanya

[1] https://mapserver.org/ogc/wfs_server.html<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmapserver.org%2Fogc%2Fwfs_server.html&data=05%7C01%7Csteve.lime%40state.mn.us%7C92de1711c522429f56dd08dadfb299cb%7Ceb14b04624c445198f26b89c2159828c%7C0%7C0%7C638068255436232436%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=otZ4PYcfHKAkflyChwsf2W6%2BmGDt4GXKBjNcb0XlOKA%3D&reserved=0>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20221217/2117eef8/attachment.htm>


More information about the MapServer-users mailing list