http://www.usf.uos.de/~jwagner/gen2shp/gen2shp.html
 
InstituteStudies
People
Projekte

Search


(Diese Seite ist nicht in deutsch verfügbar)

gen2shp: converts ArcInfo generate format to shapefile format

This is an old homepage of gen2shp stopping with version 0.2.3. See the new homepage for versions 0.3.0 and higher.

[ Software ]

What is it?

gen2shp is a simple C-Progam which can read the format required by the ArcInfo generate command. The data in this file will be converted to the shapefile format which actually means to three files: .shp, .shx and .dbf.

Why was it developed?

Within the framework of my PhD thesis I have implemented an automatic processing scheme to create ready-to-use data sets for GREAT-ER (Geography-referenced Regional Exposure Assessment Tool for European Rivers). Among these are several geodata sets for use in ArcView. As a starting point all data are requested in a specific text file format. For the further processing of these file and (as a part of it) for the creation of geodata to be loaded in ArcView I had three requirements: All parts of the methodology have
  1. to be independent of any commercial product. Hence, the whole methodology can be made freely available.
  2. to be platform independent. Hence, almost anyone who is interested can execute the methodology.
  3. to have a commandline interface. Hence the command sequence can be handed over to a makefile and this way be made 100% automatic.

History

Changes from 0.2.2 to 0.2.3

ArcInfo uses "D" instead of "E" for the exponent representation. This was not considered in the previous version, it was necessary to replace "D" by "E" before issuing gen2shp. This is fixed now.

Previous releases only accepted "," as delimiter. Now also spaces are accepted. Furthermore any sequence of delimiters is treated as one delimiter (this was different in the previous version!).

Thanks to Markus Neteler, University of Hannover and to gen2shp user named Eric.

Changes from 0.2.1 to 0.2.2

ArcInfo handles the keyword "end" case-insensitiv. Now gen2shp does, too. Thanks to Doug Nebert of the Federal Geographic Data Committee for that hint.

Changes from 0.2.0 to 0.2.1

Just a typo and test with new revision of shapelib (1.2.4 to 1.2.5). Furthermore, DOS-executables are now included.

Current version

See new homepage for current versions.

The latest version on this out-of-date homepafe is 0.2.3 and can handle points, lines and polygons. It is successfully tested on a Solaris, Linux and DOS, but there is no reason why it should not work on any other.

gen2shp does the job properly I needed it for. If you have any problems applying gen2shp send me an email. By one of us or jointly the problem will surely be solved.

You will need the shapelib version 1.2.5 (or higher) which is freely available (see requirements and installation below).

Future Versions

Many features are conceivable:
  • Consideration of 3D-Objects
  • Development of 'gen2shp's counterpart: shp2gen
  • ... (tell me)

Usage

usage: gen2shp outfile type < infile
        reads stdin and creates outfile.shp, outfile.shx and outfile.dbf
        type must be one of these: points lines polygons
        infile must be in 'generate' format

Copyright and License

Copyright (C) 1999 by Jan-Oliver Wagner. The GNU GENERAL PUBLIC LICENSE applies. Absolutly No Warranty!

See head of file gen2shp.c for details.

I have used a module (utils.c) being a part of txt2dbf 1.0.2 ( dBase Tools). The author is Frank Koormann. He made the source freely available in the common sense - thanks, Frank.

Requirements

shapelib 1.2.5

Developed by Frank Warmerdam. Download from Shapelib Homepage.

Open source licensed and hence freely available in the common sense. Thanks Frank.

Download

gen2shp-0.2.3.zip (32 kBytes, DOS-executable included, old)

shapelib-1.2.5.zip (499 kBytes, mirror copy, old)

shapelib-1.2.5.dosbin.zip (214 kBytes, DOS exectuables and object files, old)

Installation steps

For all standard operating system, the following steps should work:
  1. Download shapelib 1.2.5 (or higher) , install and compile it somewhere on your system.
  2. Download gen2shp, unpack files somewhere on your system.
  3. Open the makefile of gen2shp and adjust SHAPELIBPATH to the corresponding paths you have created in the first step.
  4. Execute 'make'. Everything should work.
For DOS/Windows platforms, however, people often had problems to create the executables from the sources. Since several requests arrived, I have created DOS-executables and Object files (it took 20 minutes though I am not familiar with MSVC). See for the exe-files in the download section above. From version 0.2.3 on I have moved to gcc for Windows. Took me 5 minutes.

generate Format

You may refer to ArcInfo documentation (if available). Examples should illustrate format as well:

Example: points

8,-1.405877,53.721508
13,-2.045479,53.731064
14,-1.984840,53.731972
15,-1.925755,53.710373
16,-1.889399,53.706749
17,-1.859130,53.696831
18,-1.730477,53.681328
19,-1.719866,53.683102
20,-1.604871,53.673790
21,-1.547393,53.669090
end

Example: lines

12033
-1.352874,53.629650
-1.352463,53.629875
-1.351808,53.630165
-1.351263,53.630173
-1.350566,53.630314
-1.349868,53.630444
-1.349170,53.630573
-1.348428,53.630669
END
26456
-1.360715,53.624237
-1.358755,53.623821
-1.356220,53.623493
-1.352882,53.623207
-1.350488,53.623516
-1.349195,53.624039
-1.347095,53.625870
-1.349000,53.628876
-1.348428,53.630669
end
9033
-1.371616,53.643658
-1.367998,53.642830
end
9037
-1.395607,53.669220
-1.394491,53.669979
-1.393896,53.671398
-1.393909,53.673672
-1.390823,53.674545
-1.383970,53.675240
-1.381641,53.674030
-1.375354,53.673252
-1.371793,53.672478
end
end

Example: polygons

1
0,0
1,0
1,1
0,1
0,0
end
2
10,10
10,11
11,11
11,10
10,10
end
end
 
Internal | Infoservice last modified: August 2000
E-Mail: jwagner@usf.Uni-Osnabrueck.DE