Discussion:
[Geoserver-users] Number of decimal places in WFS
Antonis Christofides
2017-07-12 10:15:22 UTC
Permalink
Hello,

I have a layer which has some properties that geoserver indicates are "Double".
If I get these properties through WFS (e.g.
http://chemicalse.etme.gr/geoserver/etme/ows?service=WFS&version=1.1.0&request=GetFeature&typename=etme:DIKTYO_EPIFANEIAKWN_POTAMIA&srsname=EPSG:3857&outputformat=gml3),
here is (part of) what I get (I've bolded the problem):

<etme:DIKTYO_EPIFANEIAKWN_POTAMIA gml:id="DIKTYO_EPIFANEIAKWN_POTAMIA.1">
<etme:the_geom>
<gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#3857" srsDimension="2">
<gml:pos>2413731.81975826 4690224.47314216</gml:pos>
</gml:Point>
</etme:the_geom>
***<etme:A_A>1.0</etme:A_A>*
<etme:CODE>1-P-KARPENISIOTIS</etme:CODE>
<etme:P_E>Åõñõôáíßáò</etme:P_E>
</etme:DIKTYO_EPIFANEIAKWN_POTAMIA>

OpenLayers thinks that the etme:A_A property is a string (whereas in geoserver,
as I said, it is registered as "Double"). Is this a geoserver issue or a WFS
limitation?

In addition, if I ask for json instead of gml3, the value is still a string, but
it shows as "1", without decimal places. Why is this?

(I'm running geoserver 2.11.1).

Thanks!
--
Antonis Christofides
+30-2118000592 (work)
+30-6979924665 (mobile)
Andrea Aime
2017-07-12 13:07:35 UTC
Permalink
On Wed, Jul 12, 2017 at 12:15 PM, Antonis Christofides <
Post by Antonis Christofides
Hello,
I have a layer which has some properties that geoserver indicates are
"Double". If I get these properties through WFS (e.g.
http://chemicalse.etme.gr/geoserver/etme/ows?service=
DIKTYO_EPIFANEIAKWN_POTAMIA&srsname=EPSG:3857&outputformat=gml3), here is
<etme:DIKTYO_EPIFANEIAKWN_POTAMIA gml:id="DIKTYO_EPIFANEIAKWN_POTAMIA.1">
<etme:the_geom>
<gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#3857" <http://www.opengis.net/gml/srs/epsg.xml#3857> srsDimension="2">
<gml:pos>2413731.81975826 4690224.47314216</gml:pos>
</gml:Point>
</etme:the_geom>
*<etme:A_A>1.0</etme:A_A>*
<etme:CODE>1-P-KARPENISIOTIS</etme:CODE>
<etme:P_E>ΕυρυταΜίας</etme:P_E>
</etme:DIKTYO_EPIFANEIAKWN_POTAMIA>
OpenLayers thinks that the etme:A_A property is a string (whereas in
geoserver, as I said, it is registered as "Double"). Is this a geoserver
issue or a WFS limitation?
It's an issue in OpenLayers, I guess it's not running DescribeFeatureType
to determine the attribute type? The schema says double:

http://chemicalse.etme.gr/geoserver/etme/ows?service=WFS&version=1.1.0&request=DescribeFeatureType&typename=etme:DIKTYO_EPIFANEIAKWN_POTAMIA
Post by Antonis Christofides
In addition, if I ask for json instead of gml3, the value is still a
string, but it shows as "1", without decimal places. Why is this?

I don't see that, run as json and got a number:

http://chemicalse.etme.gr/geoserver/etme/ows?service=WFS&version=1.1.0&request=GetFeature&typename=etme:DIKTYO_EPIFANEIAKWN_POTAMIA&srsname=EPSG:3857&outputformat=application/json

...
type: "Feature",
id: "DIKTYO_EPIFANEIAKWN_POTAMIA.1",
geometry: {
type: "Point",
coordinates: [
2413731.81975826,
4690224.47314216
]
},
geometry_name: "the_geom",
properties: {
*A_A: 1,*
CODE: "1-P-KARPENISIOTIS",
X: 298578,
Y: 4294639,
P_E: "ΕυρυταΜίας"
}
...
--
Regards,

Andrea Aime

==
GeoServer Professional Services from the experts! Visit http://goo.gl/it488V
for more information.
==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo Ú consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.
Loading...