Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • clipgeo: A Stata package for clipping Stata polyline and polygons on a bounding box

    Dear all,

    I have uploaded the beta version of the "clipgeo" package on GitHub for testing: https://github.com/asjadnaqvi/stata-clipgeo

    Examples are also there. I presented this at the Stata Oceania 2022 keynote and finally ended up coding it into an ado. It allows us to clip Stata _shp.dta file on a custom bounding box.

    The command is fairly straightforward:

    Code:
    clippolyline road_shp, box(-5000,10000,335000,345000)
    
    clippolygon nuts0_shp, box(128, 146, -94, -80)

    It generates a _shp_clipped.dta file that can be used with spmap. This allows us to easily zoom into regions. clippolygeo also gives errors for some polygon types and I am looking into it.

    But please suggest command enhancements etc. I will submit it to SSC in some weeks.

    Best,

    Asjad



    Click image for larger version

Name:	clippolygon0.png
Views:	1
Size:	141.7 KB
ID:	1658081 Click image for larger version

Name:	clippolyline3.png
Views:	1
Size:	1.34 MB
ID:	1658082
    Last edited by Asjad Naqvi; 05 Apr 2022, 11:13.
Working...
X