Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: Error using shp2dta

From   "Kevin Crow - StataCorp" <>
To   <>
Subject   st: Re: Error using shp2dta
Date   Fri, 5 May 2006 10:21:17 -0500


-shp2dta- can only convert polygon shapefiles (type 5). There are many other types of shapefiles but these shapefiles will not work with -tmap-. You can read more about the different types of shapefiles at the below URL.


----- Original Message ----- From: "Taavi Lai" <>
To: <>
Sent: Friday, May 05, 2006 5:55 AM
Subject: st: Error using shp2dta

Dear statalist,

After downloading a number of Europe shape files I tried to convert all these to suite -tmap- using -shp2dta- but got an error message (output below).
That raised two questions:

1) do you have suggestions how to improve the code (or were to look for solution) so that the do file wouldn't abort in case of errors
2) I guess that shapefile causing the error is not of a type suitable for -shp2dta- and therefore - is there a way to make these suitable for -shp2dta-

Best regards,

. fs *.shp
bndnetarcs.shp hydronetpols.shp miscpolypols.shp translnkarcs.shp transnetpols.shp
bndnetpols.shp misclinkarcs.shp poppointpnts.shp translnknods.shp vegpolyarcs.shp
hydronetarcs.shp misclinkpnts.shp poppolyarcs.shp translnkpnts.shp vegpolypols.shp
hydronetnods.shp miscpolyarcs.shp poppolypols.shp transnetarcs.shp

. foreach f in `r(files)' {
2. local pos=strpos("`f'",".")
3. local f = substr("`f'",1,`pos'-1)
4. quiet: shp2dta using `f', database("`f'_database") coordinates("`f'_coordinates") replace
5. }
bndnetarcs.shp: polygon shapefile required

end of do-file

* For searches and help try:

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index