Announcement

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

  • spmap - creating a line data set

    Dear all,

    I used spmap to create a map which divdes Germany into two parts (treatment and control). The treatment assignment I did manually.
    Now I would like to create a line dataset, which runs along the border of the treatment and control group. This is needed for later analysis. Does anybody know a way to do this? I assume it's possible with some GIS software, but of course it would be convenient if this could be done directly in Stata.

    The information should be in the shapefile, but of course I don't want to use the whole polygons at the bordering counties, but only the part that borders with another county so that I could create the line data set.

    I hope my issue is clear.

    Thanks a lot in advance for any suggestions!

    Best,
    Jonas
    Last edited by Jonas Jessen; 11 May 2018, 02:42.

  • #2
    You might try Robert Picard and Michel Stepner's mergepoly

    Code:
    . ssc desc mergepoly
    
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    package mergepoly from http://fmwww.bc.edu/repec/bocode/m
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    TITLE
          'MERGEPOLY': module to merge adjacent polygons from a shapefile
    
    DESCRIPTION/AUTHOR(S)
          
           mergepoly inputs a shapefile in the dual Stata dataset format
          generated by -shp2dta- (SSC) and merges adjacent polygons by
          removing all shared line segments and reconnecting the remaining
          line segments into polygons that follow the outer borders of the
          original polygons. The -by()- option can be used to merge
          features by attribute groups. You can, for example, merge U.S.
          State boundaries by Census division codes and create a new
          shapefile that describes the division boundaries. The shapefile
          produced by mergepoly is in a format that can be immediately
          visualized using -spmap- (SSC).

    Comment


    • #3
      Hi Scott,

      thanks for your suggestion, I was not aware of mergepoly. Unfortunately the programme does exactly the opposite of my aim. Mergepoly essentially merges adjacent polygons to a new one (i.e. removing the borders). I however want to create a new line shapefile consisting of the borders of neighbouring polygons assigned to different groups.

      Best,
      Jonas

      Comment

      Working...
      X