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.
@dracos dracos force-pushed the master branch 3 times, most recently from f8a2f78 to bcb87c5 Compare June 7, 2016 17:10
@jukesie jukesie closed this Nov 20, 2017
@jukesie jukesie removed the Reviewing label Nov 20, 2017
@dracos dracos reopened this Nov 20, 2017
@dracos dracos force-pushed the master branch 2 times, most recently from 21f5add to 8547a77 Compare March 5, 2020 19:23
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