A utility tab is provided in the meteorology, trajectory, and concentration menus that will convert an ESRI generate format text file to a Shapefile for import into ArcView or comparable GIS applications. The "ascii2shp" conversion software is available under the GNU license from the Free Software foundation. The conversion can be run from the command line or the GUI menu shown below.
Normally the fields will be blank when the menu is first invoked. Prior to creating the shapefiles it is necessary to create the "Generate" text file which contains the latitude-longitude points of each contour as created by the contouring programs available through the display menus. Checking the GIS box in the menu (-a1 option on the command line) creates these files. All generate format files start with GIS and end with .txt. The remainder of the file name depends upon the application from which it was created. However in all applications, the two-digit string prior to the .txt identifies the frame number. There is one GIS output file per frame. In the lower text entry box enter the base name of the output shapefiles. All output files will be created in the \working directory. Note that depending upon the upper level menu from which the conversion was called, the shapefile conversion will be either for lines (meteorology), points (trajectory), or polygons (concentration).
If you don't know, you probably don't need this library. The Shapefile format is a new working and interchange format promulgated by ESRI for simple vector data with attributes. It is apparently the only file format that can be edited in ARCView 2/3, and can also be exported and imported in Arc/Info. An excellent white paper on the shapefile format is available from ESRI, but it is .pdf format, so you will need Adobe Acrobat to browse it. The file format actually consists of three files.
XXX.shp - holds the actual vertices. XXX.shx - hold index data pointing to the structures in the .shp file. XXX.dbf - holds the attributes in xBase (dBase) format.Release Notes
To get notification of new releases of Shapelib subscribe to the project at www.freshmeat.net. This is currently the only reliable way of finding out about new releases since there is no shapelib specific mailing list.
Release 1.2.9: Good support for reading and writing NULL fields in .dbf files, good support for NULL shapes and addition of the DBFGetFieldIndex() functions (all contributed by Jim Matthews). Bill Miller has contributed an upgraded shputils.c. Daniel Morissette contributed DBFGetNativeFieldType(). Better error checking for disk errors in dbfopen.c. Various other bug fixes and safety improvements.
Release 1.2.8: Added hacked libtool support (supplied by Jan) and "rpm ready" install logic.
Release 1.2.7: Fix record size (was 4 bytes too long). Modify SHPReadObject() to handle null shapes properly. Use atof() instead of sscanf(). Support .DBF as well as .dbf.
Release 1.2.6: Now available under old MIT style license, or at the user's option, LGPL. Added the contrib directory of stuff from Carl Anderson and the shptree.c API for quadtree based spatial searches.
Release 1.2.5: SHPOpen() now forcibly uses "rb" or "r+b" access string to avoid common mistakes on Windows. Also fixed a serious bug with .dbf files with a 'F' field type.
Release 1.2.4: DBFOpen() will now automatically translate a .shp extension to .dbf for convenience. SHPOpen() will try datasets with lower and uppercase extension. DBFAddField() now returns the field number, not TRUE/FALSE.
Release 1.2.3: Disable writing measures to multi-patches as ArcView seems to puke on them (as reported by Monika Sester). Add white space trimming, and string/numeric attribute interchangability in DBF API as suggested by Steve Lime. Dbfdump was updated to include several reporting options.
Release 1.2.2: Added proper support for multipatch (reading and writing) - this release just for testing purposes.
Release 1.2 is mostly a rewrite of the .shp/.shx access API to account for ArcView 3.x 3D shapes, and to encapsulate the shapes in a structure. Existing code using the shapefile library will require substantial changes to use release 1.2.
Release V1.1 has been built on a number of platforms, and used by a number of people successfully. V1.1 is the first release with the xBase API documentation.
MaintainerThis library is maintained by me (Frank Warmerdam) on my own time. Please send me bug patches and suggestions for the library. Email can be sent to warmerdam@pobox.com.
The current status of the Shapelib code can be found somewhere off my home page at http://pobox.com/~warmerdam.
The shputils.c module was contributed by Bill Miller (NC-DOT) who can be reached at bmiller@doh.dot.state.nc.us. I had to modify it substantially to work with the 1.2 API, and I am not sure that it works as well as it did when it was originally provided by Bill.
CreditsI didn't start this section anywhere near soon enough, so a lot of earlier contributors to Shapelib are lost in pre-history.
I would like to dedicate Shapelib to the memory of Sol Katz. While I never met him in person, his generous contributions to the GIS community took many forms, including free distribution of a variety of GIS translators with source. The fact that he used this Shapelib in some of his utilities, and thanked me was a great encouragement to me. I hope I can do his memory honour by trying to contribute in a similar fashion.
PortabilityThe Shapefile C Library should port easily to 32bit systems with ANSI C compilers. It should work on 64 bit architectures (such as the DEC AXP). Care should also be taken to pass the binary access flag into SHPOpen() and DBFOpen() when operating on systems with special text file translation such as MSDOS. The shputils.c module is contributed, and may not take the same approach to portability as the rest of the package. On Linux, and most unix systems it should be possible to build and install shapefile support as a shared library using the "lib" and "lib_install" targets of the Makefile. Note that this Makefile doesn't use autoconf mechanisms and will generally require some hand tailoring for your environment.
LimitationsThe source for the Shapefile C Library is (c) 1998 Frank Warmerdam, and released under the following conditions. The intent is that anyone can do anything with the code, but that I do not assume any liability, nor express any warranty for this code.
As of Shapelib 1.2.6 the core portions of the library are made available under two possible licenses. The licensee can choose to use the code under either the Library GNU Public License (LGPL) described in LICENSE.LGPL or under the following MIT style license. Any files in the Shapelib distribution without explicit copyright license terms (such as this documentation, the Makefile and so forth) should be considered to have the following licensing terms. Some auxiliary portions of Shapelib, notably some of the components in the contrib directory come under slightly different license restrictions. Check the source files that you are actually using for conditions.
Default License TermsCopyright (c) 1999, Frank Warmerdam
This software is available under the following "MIT Style" license, or at the option of the licensee under the LGPL (see LICENSE.LGPL). This option is discussed in more detail in shapelib.html. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Shapelib ModificationsI am pleased to receive bug fixes, and improvements for Shapelib. Unless the submissions indicate otherwise I will assume that changes submitted to me remain under the above "dual license" terms. If changes are made to the library with the intention that those changes should be protected by the LGPL then I should be informed upon submission. Note that I will not generally incorporate changes into the core of Shapelib that are protected under the LGPL as this would effectively limit the whole file and distribution to LGPL terms.
Opting for LGPLFor licensee's opting to use Shapelib under LGPL as opposed to the MIT Style license above, and wishing to redistribute the software based on Shapelib, I would ask that all "dual license" modules be updated to indicate that only the LGPL (and not the MIT Style license) applies. This action represents opting for the LGPL, and thereafter LGPL terms apply to any redistribution and modification of the affected modules.