Dear all,
Version 1.1 of "clipgeo" is up on GitHub:
https://github.com/asjadnaqvi/stata-clipgeo
This package takes a Stata shapefile and clips it on a bounding box. It provides two commands "clippolyline" and "clipolygon" that implement different algorithms for lines and shapes respectively.
The commands are fairly straightforward, for example:
clippolyline road_shp, box(-7000,11000,330000,355000)
clippolygon nuts0_shp, box(128, 146, -94, -80)
They generate a _shp_clipped.dta file that can be swapped in the original spmap code, e.g.:
spmap CAPACITY using road_shp, id(_ID) /// osize(0.02 0.08 1.5) cln(3) legend(off)
spmap CAPACITY using road_shp_clipped, id(_ID) /// osize(0.02 0.08 1.5) cln(3) legend(off)
and thats it!
Installation instructions, data, and code on GitHub. Please test it out and report bugs and suggestions for improvement if any. I will be send to SSC soon.
Polyline example:

Polygon example:
Version 1.1 of "clipgeo" is up on GitHub:
https://github.com/asjadnaqvi/stata-clipgeo
This package takes a Stata shapefile and clips it on a bounding box. It provides two commands "clippolyline" and "clipolygon" that implement different algorithms for lines and shapes respectively.
The commands are fairly straightforward, for example:
clippolyline road_shp, box(-7000,11000,330000,355000)
clippolygon nuts0_shp, box(128, 146, -94, -80)
They generate a _shp_clipped.dta file that can be swapped in the original spmap code, e.g.:
spmap CAPACITY using road_shp, id(_ID) /// osize(0.02 0.08 1.5) cln(3) legend(off)
spmap CAPACITY using road_shp_clipped, id(_ID) /// osize(0.02 0.08 1.5) cln(3) legend(off)
and thats it!
Installation instructions, data, and code on GitHub. Please test it out and report bugs and suggestions for improvement if any. I will be send to SSC soon.
Polyline example:
Polygon example:
Comment