0

I am new to both geonode and geoserver. I have a problem with downloading xml file from layer that I uploaded. For example, I have a.shp, a.shx, a.prj, a.dbf, and a.xml. I uploaded them to geonode. I check in geoserver data directory, the files are exist. But, when I tried to download the layer in shapefile zipped format, it doesn't include the a.xml file.

I know that geoserver uses WFS. But I can't find option to download the .xml file.

How to do it? Can I access directly to the directory (which is not so good), or is there a way to do it?

  • 1
    The only compulsory parts in shapefile are .shp, .shx, and .dbf. GeoServer does not send the same files which you uploaded, it is reading the data and writing out a brand new shapefile, What information do you miss when you do not get the .xml file? – user30184 Oct 28 '15 at 7:47
  • @user30184 so we have some custom metadata that we put in the .xml file. – ismailsunni Oct 28 '15 at 8:04
  • So you need to make a custom service and edit the source code of GeoServer. Unfortunately I can't say which part and how. – user30184 Oct 28 '15 at 8:20
1

There are two "download" buttons in GeoNode layers. The zip shapefiles are in the "data download", while the xml is in the "Metadata download". You only have to choose the second one and download your metadata as "Standard-Metadata xml format". zip file will not contain it because is only for the geometry data. NOTE: this answer works in GeoNode2.6.3 version. It might be diferent in others.

0

So, I finally able to download / access the xml file that I uploaded.

def get_metadata_file_path(self):
    """Obtain metadata (.xml) file path of the layer."""
    base_file, _ = self.layer.get_base_file()
    if not base_file:
        return ''
    base_file_path = base_file.file.path
    xml_file_path = base_file_path.split('.')[0] + '.xml'
    if not os.path.exists(xml_file_path):
        return ''
    return xml_file_path

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.