Announcement

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

  • Variables created after shp2dta

    Hi everyone,

    After I run 'shp2dta' to turn shape files into Stata data files, I notice I have some new variables, mainly Shape_Are and Shape_Len, see below.

    Code:
    . **1.0 set up County summary data
    . 
    . shp2dta using "$data/SA data", ///
    > data("SA_data") ///
    > coor("SA_coordinates") ///
    > genid("id") ///
    > gencentroids("sa_cent") ///
    > replace
    type: 5
    
    . 
    end of do-file
    
    . do "C:\Users\Ivan\AppData\Local\Temp\STDbcc_000000.tmp"
    
    . use "SA_data", clear
    
    . 
    end of do-file
    
    . summ Shape__Are Shape__Len
    
        Variable |        Obs        Mean    Std. Dev.       Min        Max
    -------------+---------------------------------------------------------
      Shape__Are |     18,641     3768344     7172291   .1502686   1.63e+08
      Shape__Len |     18,641    7156.082    8808.337   141.0763   90051.82
    These measures are probably the area and length of each Geo item, but does anyone have any more information on these, the instructions for shp2dta don't discuss them much and I wasn't able to find anything online. What units are these measured in, and how are the defined more broadly? Just curious.

    Any help appreciated as usual.

  • #2
    Hello Ivan Privalko , I don't think that these variables are generated by the -shp2dta-. I think they might be contained in the attributes table for the shapes (in the accompanying DBF file), since they are mentioned here:
    https://support.esri.com/en/technical-article/000015423

    Correspondingly, if you do have them after the conversion and intend to use them, the map file producer will be in the best position to answer.

    To verify if they are converted, open the DBF file in any DBF file viewer. If you see them there, then shp2dta doesn't generate them.

    Hope this helps, Sergiy

    Comment


    • #3
      Thanks Sergiy, this is very helpful! I noticed that these appear ever time I run shp2dta but you may be right, they might be implicitly a part of the shp files! Thanks!

      Comment


      • #4
        hi, is there a way to convert shape length - shape area into latitude and longitude variables?

        thanks

        Comment


        • #5
          No, at least I don't think so. You can convert coordinates to a different projection (in Python) but you can't get coordinates by just length and area, since that doesn't make sense.

          Comment

          Working...
          X