Skip to content

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
@dracos dracos force-pushed the master branch 2 times, most recently from 367ee3c to e1a11b6 Compare May 2, 2025 15:08
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.

4 participants