GeoNode / geonode

GeoNode is an open source platform that facilitates the creation, sharing, and collaborative use of geospatial data.
https://geonode.org/
Other
1.45k stars 1.13k forks source link

Point layer uploaded as CSV cannot be added to QGIS map #5106

Closed jondoig closed 4 years ago

jondoig commented 5 years ago

Expected Behavior

CSV point data file uploaded to Geonode is added to QGIS via WFS and displays as points on map

Actual Behavior

CSV point data file uploaded to Geonode is added to QGIS via WFS and appears as a table not a layer

Steps to Reproduce the Problem

In browser:

  1. Obtain a csv point file such as Basic world cities database from simplemaps
  2. Extract the csv file worldcities.csv and inspect it: looks OK.
  3. Login to master.demo.geonode.org
  4. Upload the csv file, selecting lat and lng fields and WGS84 CRS
  5. Confirm it displays OK on the map
  6. Confirm can download via WFS, e.g. Download Layer > Data > GeoJSON: looks fine, geometry looks fine.

In QGIS (3.4.12-Madeira on Windows 10):

  1. Layer > Add Layer > Add WFS Layer > New Name: Master Geonode URL: http://master.demo.geonode.org/geoserver/ows OK
  2. Connect
  3. Select worldcities in list
  4. Add, Close

=> ERROR: Dataset geonode:worldcities is added as a table not a layer

But the same CSV dataset, downloaded from Geonode as shapefile and re-uploaded, works fine!

In browser:

  1. Return to worldcities layer on master.demo.geonode.org
  2. Download Layer > Data > Zipped Shapefile

In File Explorer:

  1. Extract zip file
  2. Rename files worldcities. to worldcities_shape.
  3. Select the 5 shapefiles worldcities_shape.* and zip into worldcities_shape.zip

In browser:

  1. Upload worldcities_shape.zip
  2. Click Layer Info
  3. Confirm looks OK on map

In QGIS:

  1. Layer > Add Layer > Add WFS Layer > Master Geonode
  2. Connect
  3. Select worldcities_shape in list
  4. Add, Close
  5. Zoom to Layer

=> SUCCESS: Dataset worldcities_shape is added to map as a layer

image

Specifications

t-book commented 5 years ago

@jondoig

Tested both with Madeira: a new point layer: http://master.demo.geonode.org/layers/geonode:ao

and your cities, both do show up without problems? Would you kindly test some other point source (non geonode to be sure it's not your qgis installation?)

Bildschirmfoto 2019-10-24 um 10 55 51 Bildschirmfoto 2019-10-24 um 10 53 54
gannebamm commented 5 years ago

@t-book I think he uses WFS and you use WMS? Would test myself, but our network is currently messy :|

t-book commented 5 years ago

@gannebamm good point. did a test and can reproduce it now. but still think this is connected to madeira. will test tomorrow with las palmas (?) whatever name qgis 2.18 😂

jondoig commented 5 years ago

Same on QGIS 3.4.11 - I tested that and upgraded to "latest LTS" 3.4.12 Madeira, same result.

Also same for AURIN who were trying to use WFS to ingest our data to their system. They reported their process can't get past DescribeFeatureType.

Armed with this I tried a DescribeFeatureType and found a key difference:


  | <?xml version="1.0" encoding="UTF-8"?><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:geonode="http://www.geonode.org/" xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified" targetNamespace="http://www.geonode.org/">
-- | --
  | <xsd:import namespace="http://www.opengis.net/gml" schemaLocation="http://master.demo.geonode.org/geoserver/schemas/gml/2.1.2/feature.xsd?access_token=1mtffvrmg5hQfKA48wpRUpa4coKUjV"/>
  | <xsd:complexType name="worldcitiesType">
  | <xsd:complexContent>
  | <xsd:extension base="gml:AbstractFeatureType">
  | <xsd:sequence>
  | <xsd:element maxOccurs="1" minOccurs="1" name="fid" nillable="false" type="xsd:int"/>
  | <xsd:element maxOccurs="1" minOccurs="0" name="city" nillable="true" type="xsd:string"/>
  | <xsd:element maxOccurs="1" minOccurs="0" name="city_ascii" nillable="true" type="xsd:string"/>
  | <xsd:element maxOccurs="1" minOccurs="0" name="country" nillable="true" type="xsd:string"/>
  | <xsd:element maxOccurs="1" minOccurs="0" name="iso2" nillable="true" type="xsd:string"/>
  | <xsd:element maxOccurs="1" minOccurs="0" name="iso3" nillable="true" type="xsd:string"/>
  | <xsd:element maxOccurs="1" minOccurs="0" name="admin_name" nillable="true" type="xsd:string"/>
  | <xsd:element maxOccurs="1" minOccurs="0" name="capital" nillable="true" type="xsd:string"/>
  | <xsd:element maxOccurs="1" minOccurs="0" name="population" nillable="true" type="xsd:string"/>
  | <xsd:element maxOccurs="1" minOccurs="0" name="id" nillable="true" type="xsd:int"/>
  | <xsd:element maxOccurs="1" minOccurs="0" name="location" nillable="true" type="gml:PointPropertyType"/>
  | </xsd:sequence>
  | </xsd:extension>
  | </xsd:complexContent>
  | </xsd:complexType>
  | <xsd:element name="worldcities" substitutionGroup="gml:_Feature" type="geonode:worldcitiesType"/>
  | </xsd:schema>
  |  

, while:



That would explain why QGIS treats it as table not layer.
jondoig commented 4 years ago

Ping @t-book did you see my last comment?

t-book commented 4 years ago

@jondoig sorry I've absolutely missed this!

That would explain why QGIS treats it as table not layer.

This makes definitely sense and either looks like a regression or some change on geoserver side. I will try to do some investigations as well! thanks for reporting!

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

jondoig commented 4 years ago

ping @t-book any chance you could look at this?

t-book commented 4 years ago

@jondoig sorry for being quite.

any chance you could look at this?

Unfortunately at earliest starting of February ;/

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.