Announcement

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

  • Failing to convert .shp and .dbf dile to .dta format

    Hello,

    I'm trying to convert a gis file to .dta format. To answer a few questions: .shp and .dbf are in the same directory and there is no mistake in selecting the right directory. I used the same coding to convert other gis files before and it worked. But, for some reason it's not working. Any idea why ?

    Code:
    spshape2dta "Georgia.shp", replace saving(Georgia2014)
      (importing .shp file)
                 st_sstore():  3300  argument out of range
          import_shp_polym():     -  function returned error
    import_shp_read_shapes():     -  function returned error
    import_shp_read_write_data():     -  function returned error
                import_shp():     -  function returned error
                     <istmt>:     -  function returned error
    could not import .shp file
    r(3300);

  • #2
    Whatever the problem is, the spshape2dta command did not anticipate it, because the error message is uninformative to the end user, although perhaps not to the developer. So even if you made a mistake, this is evidence of an area that needs attention from the developers.

    Since spshape2dta is part of official Stata, you should enlist the aid of Stata Technical Services, following the steps described at

    https://www.stata.com/support/tech-support/

    Comment


    • #3
      Show what happens when you do
      Code:
      cls
      
      
      
      copy "https://www2.census.gov/geo/tiger/TIGER2021/STATE/tl_2021_us_state.zip" "tl_2021_us_state.zip", replace
      
      
      unzipfile tl_2021_us_state, replace
      
      spshape2dta "tl_2021_us_state.shp", replace saving(US)
      
      u US, clear
      
      keep if _ID ==22
      
      br

      Comment


      • #4
        Originally posted by Jared Greathouse View Post
        Show what happens when you do
        Code:
        cls
        
        
        
        copy "https://www2.census.gov/geo/tiger/TIGER2021/STATE/tl_2021_us_state.zip" "tl_2021_us_state.zip", replace
        
        
        unzipfile tl_2021_us_state, replace
        
        spshape2dta "tl_2021_us_state.shp", replace saving(US)
        
        u US, clear
        
        keep if _ID ==22
        
        br
        The whole code runs on stata and this is the attached output

        Comment


        • #5
          Here is the attached output
          Attached Files

          Comment


          • #6
            Originally posted by William Lisowski View Post
            Whatever the problem is, the spshape2dta command did not anticipate it, because the error message is uninformative to the end user, although perhaps not to the developer. So even if you made a mistake, this is evidence of an area that needs attention from the developers.

            Since spshape2dta is part of official Stata, you should enlist the aid of Stata Technical Services, following the steps described at

            https://www.stata.com/support/tech-support/
            Do I need to open this file in QGIS , then I need to import the same file as .shp file to see if I can get the uncorrupted .shp file ??

            Comment


            • #7
              You don't need QGIS for anything unless you're interested in doing some particularly sexy data management with a shapefile.


              But you just wanna unzip it right and make a shapefile right?

              Comment

              Working...
              X