Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --only-with to mapit_import so you can only import particular areas #200

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mhl
Copy link
Contributor

@mhl mhl commented Jul 16, 2015

Sometimes one has to deal with a shapefile which has many features in
it, but you only want to import some subset based on key / value
combinations of their fields. This commit adds the --only-with option
to let you specify that only features with particular properties should
be imported from the file. For example, you could do:

./manage.py mapit_import \
    --only-with=TIPO:CIUDAD \
    --only-with=PROVINCIA:'BUENOS AIRES' \
    ...
    010_Ejidos_Urbanos.shp

... to only import the boundaries of cities in the province of Buenos
Aires.

FIXME: It'd be nice if there were an example ESRI Shapefile in the
MapIt fixtures so I could write a test for this, but I couldn't find a good
example file that would be small, acceptably licensed and contain
a few features with different properties.

Sometimes one has to deal with a shapefile which has many features in
it, but you only want to import some subset based on key / value
combinations of their fields.  This commit adds the --only-with option
to let you specify that only features with particular properties should
be imported from the file. For example, you could do:

    ./manage.py mapit_import \
        --only-with=TIPO:CIUDAD \
        --only-with=PROVINCIA:'BUENOS AIRES' \
        ...
        010_Ejidos_Urbanos.shp

... to only import the boundaries of cities in the province of Buenos
Aires.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants