Dear all,

I tried to use the readOGR from package rgdal to read a geoJSON file from a Geoserver WFS.
I can get a SpatialPointDataFrame with this code:

url<-"http://localhost:8080/geoserver/wfs?service=WFS&version=1.0.0&request=GetFeature&outputFormat=json&typeName=mylayer";
ogrInfo(dsn=url,layer = 'OGRGeoJSON')
layer<-readOGR(dsn=url,layer = 'OGRGeoJSON')

but my problem is regarding the attributes. I have a numeric (real) field that is converted to integer. To see why readOGR had this behaviour, I downloaded my geoJSON file to explore the data: It appears that the first value for this attribute is 1, so the field is converted in integer with readOGR, and all values between 0 and 1 are set to 0.

Is there any way to force numeric attributes to real type?

I thank you in advance,

Cheers,
Emmanuel

_______________________________________________
R-sig-Geo mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to