Closed uniomni closed 13 years ago
Even though the shapefile shows up fine in Qgis and GeoServer, I noticed it has missing values and can't help wondering if the way they are represented could be the cause of this problem?
No, just verified that other datasets e.g. OSM building footprints have None for missing values and that works fine.
What are the names of the layers in question? Also, if you open the network pane of your browser's debugger, what is the GetFeatureInfo url and the response from the server?
The layer is called demo_sekolah (it comes from the shape file I mailed). I am not sure how to issue a GetFeatureInfo url - can you help? The main URL is http://127.0.0.1:8000/impact/
The GetFeatureInfo request is issued as soon as you click on the map with the (i) button pressed.
OK - I got Firebug open and selected the Net pane. Cleared everything and clicked on the feature. This gives two lines in the debugger with the responses:
301 MOVED PERMANENTLY 200 OK
And pasting the URL generated in, gives what is shown below. Clearly the features are there although not shown. Is there something in there that would cause problems (such as spaces)?
Response (Markdown bungles this, so look at the raw string):
<?xml version="1.0" encoding="UTF-8"?>
The problem with this layer is that it has an attribute with a blank in the name (Jenis Obye). Attribute names shall never have blanks in them, because blanks are invalid in XML node names. My recommendation would be to use an underscore instead.
Thanks heaps - I shall make Risiko always substitute blanks in attribute names with underscores and close this ticket when done.
Work around when generating shp files done in changeset: https://github.com/AIFDR/riab/commit/da3b26a1bffc2d9e488083630288c7da535fdbaa
However, it does not address
Re 1: As long as we request images (GetMap) and HTML (GetFeatureInfo with text/html output format, which is done in the GeoServer layer preview) only, everything will be fine. Any XML based output (GML in our case) will fail.
Re 2: It may not be necessary to fail on such layers. Instead, it could be enough to customize the schema in the GeoServer data directory by replacing blanks with e.g. underscores in attribute names. Needs more investigation.
Did some investigation and schema mapping won't help us here. A quick solution would be to use ogr2ogr on the uploaded file, before registering it in GeoServer. See http://darrencope.com/2011/04/26/renaming-fields-in-a-shapefile/. A long-term solution would be to address this as part of the GeoServer uploader improvements that OpenGeo is currently working on.
Thanks for the investigation. We can easily change the shp files here for the problem at hand but it worries me for the longer term that otherwise 'valid' shapefiles may cause this behaviour without feedback to the user. Perhaps GeoNode should raise an exception or do the replacement when blanks are encountered. I hope this issue will be flagged in the GeoNode uploader development. Many thanks
Closing this issue as far as Risiko is concerned but raised the issue in the documentation: https://github.com/AIFDR/riab/blob/develop/docs/usage/gotchas.rst
Some vector layers, when uploaded to Risiko don't show any features when clicked on. Checking with GeoServer show that the features are there.
Maybe a bug in the feature info functionality?
I will send test data separately.