Coder Social home page Coder Social logo

geonode-extract's Introduction

Extract data from a GeoNode and dump it in a folder

Features

  • Downloads data inshapefile format
  • Downloads metadata in xml format
  • Downloads styles in sld format (not yet implemented)

Installation

Get the latest release using pip or easy_install:

pip install geonode-extract

Usage

geonode-extract http://demo.geonode.org -d <dest_dir>

Known issues

  • Does not work with layers with permissions enabled

Thanks

This package exists thanks to GFDRR and the World Bank's OpenDRI initiative.

geonode-extract's People

Contributors

ingenieroariel avatar jmwenda avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

jmwenda

geonode-extract's Issues

Big rasters fail to be downloaded

[downloaded] Layer geonode:hti_boundary_community_polygon_062006 (46/116)
Could not download layer "geonode:hti_topo_contours20m_line_092008".
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/extract/data.py", line 292, in ge
t_data
download_layer(layer, url, dest_dir, username, password)
File "/usr/local/lib/python2.6/dist-packages/extract/data.py", line 120, in do
wnload_layer
content = r.content
File "/usr/local/lib/python2.6/dist-packages/requests/models.py", line 782, in
content
self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes
()
MemoryError

Error raised when the default style has not the same name as the layer

An error is raised when the default style has not the same name as the layer and it stops the export if the ignore-errors flag is not on.

It is an http 404 error because the get_style function https://github.com/GFDRR/geonode-extract/blob/master/extract/data.py#L65 is using the layer name to determine the SLD style name but it can be different.

A fix can be to use gsconfig to get the default style href with something like that

cat = Catalog (url, username, password)
layer = cat.get_layer(layer['name']))
requests.get(layer.default_style.body_href(),auth=(username,password)

An extra feature can be to also to export all alternative styles for the layer. Alternative styles that can be accessed like this:

layer.styles[i].body_href()

Consolidate support for version 1.2 and 2.0

The master branch supports the 1.2 version. The dev branch has some modifications to work with the 2.0 version.
Both should be merged and a command line option should be added to choose the version.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.