使用shp2dta转换shapefile后没有任何观察结果

时间:2018-06-20 12:59:08

标签: stata

我想制作一张尼泊尔地区地图。

我从ArcGIS下载了名为NP_75DWGS84的相应shapefile,并继续使用以下Stata命令:

cd "$original_dta/NP_75DWGS84"

shp2dta using NP_75DWGS84, database(data) coordinates(coord) genid(id) replace

但是,一旦我要求描述数据,就会出现以下输出:

Contains data
  obs:             0                          
 vars:             0                          
 size:             0                          
Sorted by: 

您知道为什么要删除观察结果吗?

1 个答案:

答案 0 :(得分:1)

命令shp2dta社区贡献的,可以从SSC下载:

. ssc install shp2dta

位于Stata工作文件夹中的data (解压缩)中,语法为:

. shp2dta using NP_75DWGS84, database(data) coordinates(coord) genid(id) replace
type: 5

在那里创建以下两个数据集:

  1. data.dta
  2. coord.dta

但是,它不会自动加载其中的任何一个

. describe

Contains data
  obs:             0                          
 vars:             0                          
 size:             0                          
Sorted by: 

您只需要自己使用use

. use data.dta

. describe

Contains data from data.dta
  obs:            75                          
 vars:             8                          
 size:         3,450                          
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
              storage   display    value
variable name   type    format     label      variable label
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
DIST_ID         byte    %10.0g                DIST_ID
DISTRICT        str14   %14s                  DISTRICT
ZONE_NAME       str10   %10s                  ZONE_NAME
REGION          str11   %11s                  REGION
DISS            byte    %10.0g                DISS
Xc              float   %9.0g                 Xc
Yc              float   %9.0g                 Yc
id              byte    %12.0g                
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Sorted by: id

. use coord.dta

. describe

Contains data from coord.dta
  obs:       337,488                          
 vars:             3                         
 size:     5,737,296                          
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
              storage   display    value
variable name   type    format     label      variable label
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
_ID             byte    %12.0g                
_X              double  %10.0g                
_Y              double  %10.0g                
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Sorted by: _ID