shp 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +34 -0
- data/.travis.yml +4 -0
- data/Gemfile +3 -0
- data/LICENSE +28 -0
- data/README.md +30 -0
- data/Rakefile +23 -0
- data/ext/shp/base.hpp +113 -0
- data/ext/shp/dbf.cpp +381 -0
- data/ext/shp/dbf.hpp +44 -0
- data/ext/shp/extconf.rb +13 -0
- data/ext/shp/shape_object.cpp +58 -0
- data/ext/shp/shape_object.hpp +27 -0
- data/ext/shp/shapefile.cpp +299 -0
- data/ext/shp/shapefile.hpp +35 -0
- data/ext/shp/shapelib/.cvsignore +15 -0
- data/ext/shp/shapelib/ChangeLog +450 -0
- data/ext/shp/shapelib/HOWTO-RELEASE +16 -0
- data/ext/shp/shapelib/LICENSE.LGPL +483 -0
- data/ext/shp/shapelib/Makefile +113 -0
- data/ext/shp/shapelib/README +41 -0
- data/ext/shp/shapelib/README.tree +172 -0
- data/ext/shp/shapelib/contrib/.cvsignore +12 -0
- data/ext/shp/shapelib/contrib/Makefile +66 -0
- data/ext/shp/shapelib/contrib/ShapeFileII.pas +234 -0
- data/ext/shp/shapelib/contrib/Shape_PointInPoly.cpp +238 -0
- data/ext/shp/shapelib/contrib/Shape_PointInPoly_README.txt +59 -0
- data/ext/shp/shapelib/contrib/csv2shp.c +558 -0
- data/ext/shp/shapelib/contrib/dbfcat.c +166 -0
- data/ext/shp/shapelib/contrib/dbfinfo.c +106 -0
- data/ext/shp/shapelib/contrib/makefile.vc +34 -0
- data/ext/shp/shapelib/contrib/my_nan.h +46 -0
- data/ext/shp/shapelib/contrib/shpcat.c +100 -0
- data/ext/shp/shapelib/contrib/shpcentrd.c +159 -0
- data/ext/shp/shapelib/contrib/shpdata.c +129 -0
- data/ext/shp/shapelib/contrib/shpdxf.c +340 -0
- data/ext/shp/shapelib/contrib/shpfix.c +110 -0
- data/ext/shp/shapelib/contrib/shpgeo.c +1595 -0
- data/ext/shp/shapelib/contrib/shpgeo.h +154 -0
- data/ext/shp/shapelib/contrib/shpinfo.c +113 -0
- data/ext/shp/shapelib/contrib/shpproj.c +260 -0
- data/ext/shp/shapelib/contrib/shpsort.c +605 -0
- data/ext/shp/shapelib/contrib/shpsort.txt +44 -0
- data/ext/shp/shapelib/contrib/shpwkb.c +123 -0
- data/ext/shp/shapelib/contrib/tests/shpproj.sh +38 -0
- data/ext/shp/shapelib/dbfopen.c +2221 -0
- data/ext/shp/shapelib/makefile.vc +86 -0
- data/ext/shp/shapelib/makeshape.sh +21 -0
- data/ext/shp/shapelib/mkdist.sh +37 -0
- data/ext/shp/shapelib/mkinstalldirs +38 -0
- data/ext/shp/shapelib/mkrelease.sh +55 -0
- data/ext/shp/shapelib/safileio.c +286 -0
- data/ext/shp/shapelib/shapefil.h +647 -0
- data/ext/shp/shapelib/shapelib.def +46 -0
- data/ext/shp/shapelib/shpopen.c +2388 -0
- data/ext/shp/shapelib/shptree.c +1187 -0
- data/ext/shp/shapelib/shputils.c +1072 -0
- data/ext/shp/shapelib/stream1.out +1465 -0
- data/ext/shp/shapelib/stream1.sh +28 -0
- data/ext/shp/shapelib/stream2.out +530 -0
- data/ext/shp/shapelib/stream2.sh +11 -0
- data/ext/shp/shapelib/stream3.out +37 -0
- data/ext/shp/shapelib/web/.cvsignore +2 -0
- data/ext/shp/shapelib/web/codepage.html +403 -0
- data/ext/shp/shapelib/web/dbf_api.html +436 -0
- data/ext/shp/shapelib/web/index.html +235 -0
- data/ext/shp/shapelib/web/license.html +78 -0
- data/ext/shp/shapelib/web/manifest.html +87 -0
- data/ext/shp/shapelib/web/release.html +80 -0
- data/ext/shp/shapelib/web/shapelib-tools.html +352 -0
- data/ext/shp/shapelib/web/shp_api.html +376 -0
- data/ext/shp/shp.cpp +19 -0
- data/ext/shp/shp.hpp +47 -0
- data/lib/shp.rb +35 -0
- data/lib/shp/version.rb +3 -0
- data/shp.gemspec +23 -0
- data/spec/shp_spec.rb +127 -0
- metadata +176 -0
@@ -0,0 +1,78 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>Shapelib License</title>
|
4
|
+
<link href="http://www.maptools.org/maptools.css" rel="stylesheet" type="text/css">
|
5
|
+
</head>
|
6
|
+
|
7
|
+
<body>
|
8
|
+
<h1>License</h1>
|
9
|
+
|
10
|
+
The source for the Shapefile C Library is (c) 1998 Frank Warmerdam,
|
11
|
+
and released under the following conditions. The intent is that anyone
|
12
|
+
can do anything with the code, but that I do not assume any liability, nor
|
13
|
+
express any warranty for this code. <p>
|
14
|
+
|
15
|
+
As of Shapelib 1.2.6 the core portions of the library are made available
|
16
|
+
under two possible licenses. The licensee can choose to use the code
|
17
|
+
under either the Library GNU Public License (LGPL) described in
|
18
|
+
LICENSE.LGPL or under the following MIT style license. Any files in
|
19
|
+
the Shapelib distribution without explicit copyright license terms
|
20
|
+
(such as this documentation, the Makefile and so forth) should be
|
21
|
+
considered to have the following licensing terms. Some auxilary portions
|
22
|
+
of Shapelib, notably some of the components in the contrib directory
|
23
|
+
come under slightly different license restrictions. Check the source
|
24
|
+
files that you are actually using for conditions.<p>
|
25
|
+
|
26
|
+
<h3>Default License Terms</h3>
|
27
|
+
|
28
|
+
<quote>
|
29
|
+
Copyright (c) 1999, Frank Warmerdam<p>
|
30
|
+
|
31
|
+
This software is available under the following "MIT Style" license,
|
32
|
+
or at the option of the licensee under the LGPL (see LICENSE.LGPL). This
|
33
|
+
option is discussed in more detail in shapelib.html.<p>
|
34
|
+
|
35
|
+
Permission is hereby granted, free of charge, to any person obtaining a
|
36
|
+
copy of this software and associated documentation files (the "Software"),
|
37
|
+
to deal in the Software without restriction, including without limitation
|
38
|
+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
39
|
+
and/or sell copies of the Software, and to permit persons to whom the
|
40
|
+
Software is furnished to do so, subject to the following conditions:<p>
|
41
|
+
|
42
|
+
The above copyright notice and this permission notice shall be included
|
43
|
+
in all copies or substantial portions of the Software.<p>
|
44
|
+
|
45
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
46
|
+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
47
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
48
|
+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
49
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
50
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
51
|
+
DEALINGS IN THE SOFTWARE.<p>
|
52
|
+
</quote>
|
53
|
+
|
54
|
+
<h3>Shapelib Modifications</h3>
|
55
|
+
|
56
|
+
I am pleased to receive bug fixes, and improvements for Shapelib. Unless
|
57
|
+
the submissions indicate otherwise I will assume that changes submitted to
|
58
|
+
me remain under the the above "dual license" terms. If changes are made
|
59
|
+
to the library with the intention that those changes should be protected by
|
60
|
+
the LGPL then I should be informed upon submission. Note that I will not
|
61
|
+
generally incorporate changes into the core of Shapelib that are protected
|
62
|
+
under the LGPL as this would effectively limit the whole file and
|
63
|
+
distribution to LGPL terms.<p>
|
64
|
+
|
65
|
+
<h3>Opting for LGPL</h3>
|
66
|
+
|
67
|
+
For licensee's opting to use Shapelib under LGPL as opposed to the MIT
|
68
|
+
Style license above, and wishing to redistribute the software based on
|
69
|
+
Shapelib, I would ask that all "dual license" modules be updated to
|
70
|
+
indicate that only the LGPL (and not the MIT Style license) applies. This
|
71
|
+
action represents opting for the LGPL, and thereafter LGPL terms apply to
|
72
|
+
any redistribution and modification of the affected modules.<p>
|
73
|
+
|
74
|
+
</body>
|
75
|
+
</html>
|
76
|
+
|
77
|
+
|
78
|
+
|
@@ -0,0 +1,87 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>Shapefile C Library V1.2</title>
|
4
|
+
<link href="http://www.maptools.org/maptools.css" rel="stylesheet" type="text/css">
|
5
|
+
</head>
|
6
|
+
|
7
|
+
<body>
|
8
|
+
<h1>Shapelib Manifest</h1>
|
9
|
+
|
10
|
+
<ul>
|
11
|
+
<li> <b>web/index.html</b>: This file - general documentation on the
|
12
|
+
Shapefile C Library.<p>
|
13
|
+
|
14
|
+
<li> <b><a href="shp_api.html">web/shp_api.html</a></b>: Documentation
|
15
|
+
for the API for accessing the .shp/.shx files. <p>
|
16
|
+
|
17
|
+
<li> <b><a href="dbf_api.html">web/dbf_api.html</a></b>: Documentation
|
18
|
+
for the API for accessing the .dbf attribute files. <p>
|
19
|
+
|
20
|
+
<li> <b>shpopen.c</b>: C code for access to .shp/.shx vertex files.<p>
|
21
|
+
|
22
|
+
<li> <b>dbfopen.c</b>: C code for access to .dbf attribute file.<p>
|
23
|
+
|
24
|
+
<li> <b>shapefil.h</b>: Include file defining all the services of dbfopen.c
|
25
|
+
and shpopen.c.<p>
|
26
|
+
|
27
|
+
<li> <b>contrib/</b>: A directory of "in progress" contributed programs
|
28
|
+
from Carl Anderson.<p>
|
29
|
+
|
30
|
+
<li> <b>dbfcreate.c</b>: Simple example program for creating a new .dbf file.
|
31
|
+
<p>
|
32
|
+
|
33
|
+
<li> <b>dbfadd.c</b>:
|
34
|
+
Simple example program for adding a record to a .dbf file.<p>
|
35
|
+
|
36
|
+
<li> <b>dbfdump.c</b>: Simple example program for displaying the contents of
|
37
|
+
a .dbf file.<p>
|
38
|
+
|
39
|
+
<li> <b>shpcreate.c</b>: Simple example program for creating a new .shp and
|
40
|
+
.shx file.<p>
|
41
|
+
|
42
|
+
<li> <b>shpadd.c</b>: Simple example program for adding a shape to an existing
|
43
|
+
shape file.<p>
|
44
|
+
|
45
|
+
<li> <b>shpdump.c</b>: Simple program for dumping all the vertices in a
|
46
|
+
shapefile with an indicating of the parts.<p>
|
47
|
+
|
48
|
+
<li> <b>shputils.c</b>: Complex contributed program capable of clipping and
|
49
|
+
appending
|
50
|
+
shapefiles as well as a few other things. Type shputils
|
51
|
+
after building to get a full usage message.<p>
|
52
|
+
|
53
|
+
<li> <b>Makefile</b>: A simple makefile to compile the library and example
|
54
|
+
programs.<p>
|
55
|
+
|
56
|
+
<li> <b>makeshape.sh</b>: A simple script for running some of the example
|
57
|
+
programs.<p>
|
58
|
+
|
59
|
+
<li> <b>shptest.c</b>: A simple test harnass to generate each of the supported
|
60
|
+
types of shapefiles. <p>
|
61
|
+
|
62
|
+
|
63
|
+
<li> <b>shptree.c</b>: Implements a simple quadtree algorithm for fast
|
64
|
+
spatial searches of shapefiles.<p>
|
65
|
+
|
66
|
+
<li> <b>shptreedump.c</b>: A simple mainly showing information on quad
|
67
|
+
trees build using the quad tree api.<p>
|
68
|
+
|
69
|
+
<li> <b>stream1.sh</b> - A test script, which should produce stream1.out.
|
70
|
+
Note this will only work if you have the example data downloaded.<p>
|
71
|
+
|
72
|
+
<li> <b>stream1.out</b>: Expected output of stream1.sh test script.<p>
|
73
|
+
|
74
|
+
<li> <b>stream2.sh</b>: A test script, which should produce stream2.out.<p>
|
75
|
+
|
76
|
+
<li> <b>stream2.out</b>: Expected output of stream2.sh test script.<p>
|
77
|
+
|
78
|
+
<li> <b>pyshapelib-0.1</b>: Prototype contributed Python bindings.<p>
|
79
|
+
|
80
|
+
</ul>
|
81
|
+
|
82
|
+
|
83
|
+
</body>
|
84
|
+
</html>
|
85
|
+
|
86
|
+
|
87
|
+
|
@@ -0,0 +1,80 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>Shapelib Release Notes</title>
|
4
|
+
<link href="http://www.maptools.org/maptools.css" rel="stylesheet" type="text/css">
|
5
|
+
</head>
|
6
|
+
|
7
|
+
<body>
|
8
|
+
<h1>Shapelib Release Notes</h1>
|
9
|
+
|
10
|
+
To get notification of new releases of Shapelib <i>subscribe</i> to
|
11
|
+
the project at www.freshmeat.net. This is currently the only reliable
|
12
|
+
way of finding out about new releases since there is no shapelib specific
|
13
|
+
mailing list.<p>
|
14
|
+
|
15
|
+
<b>Release 1.3.0</b>:
|
16
|
+
<ul>
|
17
|
+
<li> Major rework to us application provided hooks for file io, and error reporting (SAHooks).
|
18
|
+
<li> Added contrib/Shape_PointInPoly.cpp from Marko Podgorsek.
|
19
|
+
<li> Added shapelib tools documentation from Eduardo Patto Kanegae.
|
20
|
+
<li> Added dbf deletion support.
|
21
|
+
<li> Added DBFAddNativeFieldType().
|
22
|
+
<li> Added DBFDeleteField(), DBFReorderFields() and DBFAlterFields() to
|
23
|
+
rework DBF schema.
|
24
|
+
<li> likely a variety of other changes - it has been eight years since 1.2.10!
|
25
|
+
</ul>
|
26
|
+
|
27
|
+
<b>Release 1.2.10</b>: Added SHPRewindObject() function, and shprewind utility
|
28
|
+
program. Added FTLogical, DBFReadLogicalAttribute() and
|
29
|
+
DBFWriteLogicalAttribute() (thanks to Olek Neyman). <p>
|
30
|
+
|
31
|
+
<b>Release 1.2.9</b>: Good support for reading and writing NULL fields
|
32
|
+
in .dbf files, good support for NULL shapes and addition of the
|
33
|
+
DBFGetFieldIndex() functions (all contributed by Jim Matthews).<p>
|
34
|
+
|
35
|
+
An upgraded shputils.c has been contributed by Bill Miller. Daniel
|
36
|
+
Morissette contributed DBFGetNativeFieldType(). Better error checking
|
37
|
+
for disk errors in dbfopen.c. Various other bug fixes and safety improvements.
|
38
|
+
<p>
|
39
|
+
|
40
|
+
<b>Release 1.2.8</b>: Added hacked libtool support (supplied by Jan)
|
41
|
+
and "rpm ready" install logic.<p>
|
42
|
+
|
43
|
+
<b>Release 1.2.7</b>: Fix record size (was 4 bytes too long). Modify
|
44
|
+
SHPReadObject() to handle null shapes properly. Use atof() instead of
|
45
|
+
sscanf(). Support .DBF as well as .dbf.<p>
|
46
|
+
|
47
|
+
<b>Release 1.2.6</b>: Now available under old MIT style license, or at the
|
48
|
+
users option, LGPL. Added the contrib directory of stuff from Carl Anderson
|
49
|
+
and the shptree.c API for quadtree based spatial searches.<p>
|
50
|
+
|
51
|
+
<b>Release 1.2.5</b>: SHPOpen() now forcably uses "rb" or "r+b" access string
|
52
|
+
to avoid common mistakes on Windows. Also fixed a serious bug with .dbf
|
53
|
+
files with a 'F' field type.<p>
|
54
|
+
|
55
|
+
<b>Release 1.2.4</b>: DBFOpen() will now automatically translate a .shp
|
56
|
+
extension to .dbf for convenience. SHPOpen() will try datasets with lower
|
57
|
+
and uppercase extension. DBFAddField() now returns the field number,
|
58
|
+
not TRUE/FALSE.<p>
|
59
|
+
|
60
|
+
<b>Release 1.2.3</b>: Disable writing measures to multi-patches as ArcView
|
61
|
+
seems to puke on them (as reported by Monika Sester). Add white space
|
62
|
+
trimming, and string/numeric attribute interchangability in DBF API
|
63
|
+
as suggested by Steve Lime. Dbfdump was updated to include several
|
64
|
+
reporting options.<p>
|
65
|
+
|
66
|
+
<b>Release 1.2.2</b>: Added proper support for multipatch (reading and
|
67
|
+
writing) - this release just for testing purposes.<p>
|
68
|
+
|
69
|
+
<b>Release 1.2</b> is mostly a rewrite of the .shp/.shx access API to account
|
70
|
+
for ArcView 3.x 3D shapes, and to encapsulate the shapes in a structure.
|
71
|
+
Existing code using the shapefile library will require substantial changes
|
72
|
+
to use release 1.2.<p>
|
73
|
+
|
74
|
+
<b>Release V1.1</b> has been built on a number of platforms, and used by a
|
75
|
+
number of people successfully. V1.1 is the first release with the xBase API
|
76
|
+
documentation.<p>
|
77
|
+
|
78
|
+
|
79
|
+
</body>
|
80
|
+
</html>
|
@@ -0,0 +1,352 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>ShapeLib Tools - User Guide</title>
|
4
|
+
<link href="http://www.maptools.org/maptools.css" rel="stylesheet" type="text/css">
|
5
|
+
</head>
|
6
|
+
|
7
|
+
<body>
|
8
|
+
<h1>ShapeLib Tools - User Guide</h1>
|
9
|
+
ShapeLib is maintained by Frank Warmerdam<br>
|
10
|
+
This guide was created by <a href="http://www.consultoria.eti.br" target="_show">Eduardo Patto Kanegae</a> < eduardo<i>~at~</i>consultoria<i>~dot~</i>eti<i>~dot~</i>br >
|
11
|
+
<ul>
|
12
|
+
<li><a href="#dbfcreate">dbfcreate</a></li>
|
13
|
+
<li><a href="#dbfadd">dbfadd</a></li>
|
14
|
+
<li><a href="#dbfdump">dbfdump</a></li>
|
15
|
+
<li><a href="#shpcreate">shpcreate</a></li>
|
16
|
+
<li><a href="#shpadd">shpadd</a></li>
|
17
|
+
<li><a href="#shpdump">shpdump</a></li>
|
18
|
+
<li><a href="#shprewind">shprewind</a></li>
|
19
|
+
<li><i>Tools from ShapeLib 'contrib' directory</i>
|
20
|
+
<ul>
|
21
|
+
<li><a href="#dbfinfo">dbfinfo</a></li>
|
22
|
+
<li><a href="#dbfcat">dbfcat</a></li>
|
23
|
+
<li><a href="#shpinfo">shpinfo</a></li>
|
24
|
+
<li><a href="#shpcat">shpcat</a></li>
|
25
|
+
<li><a href="#shpcentrd">shpcentrd</a></li>
|
26
|
+
<li><a href="#shpdxf">shpdxf</a></li>
|
27
|
+
<li><a href="#shpfix">shpfix</a></li>
|
28
|
+
<li><a href="#shpproj">shpproj</a></li>
|
29
|
+
</ul>
|
30
|
+
</li>
|
31
|
+
|
32
|
+
</ul>
|
33
|
+
|
34
|
+
<h2><a name="dbfcreate">dbfcreate</a></h2>
|
35
|
+
<b>Purpose</b>: creates a new and empty .dbf file.
|
36
|
+
<br>
|
37
|
+
<b>Usage</b>: <font face="courier">dbfcreate xbase_file [[-s field_name width],[-n field_name width decimals]]...</font>
|
38
|
+
<br>
|
39
|
+
<ul>
|
40
|
+
<li><b>xbase_file</b>: the name of xBase file to be created. Doesn't need the extension.</li>
|
41
|
+
<li><b>-s field_name width</b>: creates a string field with name <u>field_name</u> and size <u>width</u>.</li>
|
42
|
+
<li><b>-n field_name width decimals</b>: creates a numeric field with name <u>field_name</u>, width of <u>width</u> and with decimals places sized by <u>decimals</u>.</li>
|
43
|
+
</ul>
|
44
|
+
<b>Example</b>
|
45
|
+
<br>
|
46
|
+
<font face="courier">$ dbfcreate testbase -s NAME 20, -n AREA 9 3, -n VALUE 9 2</font>
|
47
|
+
<br># this will create a file named testbase.dbf with 3 fields: NAME ( string (20)),
|
48
|
+
AREA ( float (9,3)) and VALUE ( float (9,2))
|
49
|
+
<br>
|
50
|
+
<hr>
|
51
|
+
|
52
|
+
<h2><a name="dbfadd">dbfadd</a></h2>
|
53
|
+
<b>Purpose</b>: adds a record into an existing .dbf file.
|
54
|
+
<br>
|
55
|
+
<b>Usage</b>: <font face="courier">dbfadd xbase_file field_values</font>
|
56
|
+
<br>
|
57
|
+
<ul>
|
58
|
+
<li><b>xbase_file</b>: the name of an existing xBase file.</li>
|
59
|
+
<li><b>field_values</b>: list of values to be inserted into the xBase file.
|
60
|
+
You must specify a number of values equal to the number of fields the xBase file has.
|
61
|
+
The order of values must also reflect the order of fields inside xBase file.</li>
|
62
|
+
</ul>
|
63
|
+
<b>Example</b>
|
64
|
+
<br>
|
65
|
+
<font face="courier">$ dbfadd testbase.dbf REGION1 25.656 150.22</font>
|
66
|
+
<br># assuming that testbase.dbf has 3 fields( NAME, AREA and VALUE), this command line
|
67
|
+
will insert a new record into testbase.dbf with the value "REGION1" for NAME,
|
68
|
+
'25.656' for AREA and '150.22' for VALUE field.
|
69
|
+
<br>
|
70
|
+
<hr>
|
71
|
+
|
72
|
+
<h2><a name="dbfdump">dbfdump</a></h2>
|
73
|
+
<b>Purpose</b>: dumps the content of a xBase file to the terminal.
|
74
|
+
<br>
|
75
|
+
<b>Usage</b>: <font face="courier">dbfdump [-h] [-r] [-m] xbase_file</font>
|
76
|
+
<br>
|
77
|
+
<ul>
|
78
|
+
<li><b>-h</b>: output header info( field descriptions).</li>
|
79
|
+
<li><b>-r</b>: output raw field info, numeric values not reformatted.</li>
|
80
|
+
<li><b>-m</b>: output one line per field.</li>
|
81
|
+
<li><b>xbase_file</b>: the name of an existing xBase file.</li>
|
82
|
+
</ul>
|
83
|
+
<b>Example</b>
|
84
|
+
<br>
|
85
|
+
<font face="courier">$ dbfdump -h testbase.dbf</font>
|
86
|
+
<br># assuming that testbase.dbf has 1 record( inserted by previous example using 'dbfadd'),
|
87
|
+
this command line will produce the following output:<br>
|
88
|
+
<font face="courier">
|
89
|
+
Field 0: Type=String, Title=`NAME', Width=20, Decimals=0<br>
|
90
|
+
Field 1: Type=Double, Title=`AREA', Width=9, Decimals=3<br>
|
91
|
+
Field 2: Type=Double, Title=`VALUE', Width=9, Decimals=2<br>
|
92
|
+
NAME AREA VALUE<br>
|
93
|
+
REGION1 25.656 150.22
|
94
|
+
</font>
|
95
|
+
<br>
|
96
|
+
<hr>
|
97
|
+
|
98
|
+
<h2><a name="shpcreate">shpcreate</a></h2>
|
99
|
+
<b>Purpose</b>: creates a new and empty shapefile.
|
100
|
+
<br>
|
101
|
+
<b>Usage</b>: <font face="courier">shpcreate shp_file [point|arc|polygon|multipoint]</font>
|
102
|
+
<br>
|
103
|
+
<ul>
|
104
|
+
<li><b>shp_file</b>: the name of shapefile to be created. Doesn't need the extension.</li>
|
105
|
+
<li><b>point/arc/polygon/multipoint</b>: the type of shapefile that you wish to create. You must specify a valid option.</li>
|
106
|
+
</ul>
|
107
|
+
<b>Example</b>
|
108
|
+
<br>
|
109
|
+
<font face="courier">$ shpcreate testpolygon polygon</font>
|
110
|
+
<br># this will create a point shapefile named testpolygon( in fact testpolygon.shp and testpolygon.shx will be created).
|
111
|
+
<br>
|
112
|
+
<hr>
|
113
|
+
|
114
|
+
<h2><a name="shpadd">shpadd</a></h2>
|
115
|
+
<b>Purpose</b>: adds a shape into an existing shapefile.
|
116
|
+
<br>
|
117
|
+
<b>Usage</b>: <font face="courier">shpadd shp_file [[x y] [+]]*</font>
|
118
|
+
<br>
|
119
|
+
<ul>
|
120
|
+
<li><b>shp_file</b>: the name of an existing shapefile.</li>
|
121
|
+
<li><b>x<sub><i>1</i></sub> y<sub><i>1</i></sub> x<sub><i>2</i></sub> y<sub><i>2</i></sub> ... x<sub><i>n</i></sub> y<sub><i>n</i></sub></b>: the set of x,y coordinates that describes the shape that you wish to add. Note that you must specify the correct number of parameters for a given type of shapefile. e.g.: for point shapefiles you have to pass 1 pair of XY coordinates and for a polygon shapefile you should pass at least 4 pairs of XY coordinates( where the first and the last point must have the same coordinates).</li>
|
122
|
+
</ul>
|
123
|
+
<b>Example</b>
|
124
|
+
<br>
|
125
|
+
<font face="courier">$ shpadd testpolygon 100000 7000000 250000 6500000 200000 6000000 100000 7000000</font>
|
126
|
+
<br># assuming that testpolygon is a polygon shapefile, this command line will insert a new shape( a triangle) into testpolygon with the following XY coordinates:<br>
|
127
|
+
vertice 0: 100000 7000000 ( this will also be the vertice where the shape starts and ends)<br>
|
128
|
+
vertice 1: 250000 6500000<br>
|
129
|
+
vertice 2: 200000 6000000<br>
|
130
|
+
vertice 3: 100000 7000000<br>
|
131
|
+
<hr>
|
132
|
+
|
133
|
+
<h2><a name="shpdump">shpdump</a></h2>
|
134
|
+
<b>Purpose</b>: dumps content of shapefile showing information like shape type, file extents, total of objects and vertices coordinates.
|
135
|
+
<br>
|
136
|
+
<b>Usage</b>: <font face="courier">shpdump [-validate] shp_file</font>
|
137
|
+
<br>
|
138
|
+
<ul>
|
139
|
+
<li><b>-validate</b>: count the number of objects that has invalid ring orderings.</li>
|
140
|
+
<li><b>shp_file</b>: the name of an existing shapefile.</li>
|
141
|
+
</ul>
|
142
|
+
<b>Example</b>
|
143
|
+
<br>
|
144
|
+
<font face="courier">$ shpdump testpolygon</font>
|
145
|
+
<br># assuming that testpolygon is an existing shapefile previously created, this command line will output the following result:
|
146
|
+
<pre>Shapefile Type: Polygon # of Shapes: 1
|
147
|
+
|
148
|
+
File Bounds: ( 100000.000, 6000000.000,0,0)
|
149
|
+
to ( 250000.000, 7000000.000,0,0)
|
150
|
+
|
151
|
+
Shape:0 (Polygon) nVertices=4, nParts=1
|
152
|
+
Bounds:( 100000.000, 6000000.000, 0, 0)
|
153
|
+
to ( 250000.000, 7000000.000, 0, 0)
|
154
|
+
( 100000.000, 7000000.000, 0, 0) Ring
|
155
|
+
( 250000.000, 6500000.000, 0, 0)
|
156
|
+
( 200000.000, 6000000.000, 0, 0)
|
157
|
+
( 100000.000, 7000000.000, 0, 0)</pre>
|
158
|
+
<hr>
|
159
|
+
|
160
|
+
<h2><a name="shprewind">shprewind</a></h2>
|
161
|
+
<b>Purpose</b>: validates and resets the winding order of rings in polygon geometries to match the ordering required by shapefile specification. This is usefull for shapefiles having troubles when checked with a 'shpdump -validate'.
|
162
|
+
<br>
|
163
|
+
<b>Usage</b>: <font face="courier">shprewind in_shp_file out_shp_file</font>
|
164
|
+
<br>
|
165
|
+
<ul>
|
166
|
+
<li><b>in_shp_file</b>: the name of an existing shapefile.</li>
|
167
|
+
<li><b>out_shp_file</b>: the name of the new fixed shapefile that will be created.</li>
|
168
|
+
</ul>
|
169
|
+
<b>Example</b>
|
170
|
+
<br>
|
171
|
+
<font face="courier">$ shprewind badshapefile newshapefile</font>
|
172
|
+
<br>
|
173
|
+
<hr>
|
174
|
+
|
175
|
+
<h2><a name="dbfinfo">dbfinfo</a></h2>
|
176
|
+
<b>Purpose</b>: displays basic information for a given xBase file, like number of columns, number of records and type of each column.
|
177
|
+
<br>
|
178
|
+
<b>Usage</b>: <font face="courier">dbfinfo xbase_file</font>
|
179
|
+
<br>
|
180
|
+
<ul>
|
181
|
+
<li><b>xbase_file</b>: the name of an existing xBase file.</li>
|
182
|
+
</ul>
|
183
|
+
<b>Example</b>
|
184
|
+
<br>
|
185
|
+
<font face="courier">$ dbfinfo testbase</font>
|
186
|
+
<br>
|
187
|
+
<pre>Info for testbase.dbf
|
188
|
+
3 Columns, 1 Records in file
|
189
|
+
NAME string (20,0)
|
190
|
+
AREA float (9,3)
|
191
|
+
VALUE float (9,2)
|
192
|
+
</pre>
|
193
|
+
<br>
|
194
|
+
<hr>
|
195
|
+
|
196
|
+
<h2><a name="dbfcat">dbfcat</a></h2>
|
197
|
+
<b>Purpose</b>: appends the records of a source xBase file into a destiny xBase file. Both files must have the same number of fields.
|
198
|
+
<br>
|
199
|
+
<b>Usage</b>: <font face="courier">dbfcat [-v] [-f] from_DBFfile to_DBFfile</font>
|
200
|
+
<br>
|
201
|
+
<ul>
|
202
|
+
<li><b>-v</b>: verbose mode.</li>
|
203
|
+
<li><b>-f</b>: forces data convertion if data field types is not the same at both files or if is there any null value into <u>from_DBFfile</u>.</li>
|
204
|
+
<li><b>from_DBFfile</b>: source xBase file.</li>
|
205
|
+
<li><b>to_DBFfile</b>: destiny xBase file.</li>
|
206
|
+
</ul>
|
207
|
+
<b>Example</b>
|
208
|
+
<br>
|
209
|
+
<font face="courier">$ dbfcat -v testbase1 testbase2</font>
|
210
|
+
<br>
|
211
|
+
<hr>
|
212
|
+
|
213
|
+
<h2><a name="shpinfo">shpinfo</a></h2>
|
214
|
+
<b>Purpose</b>: displays basic information for a given shapefile, like shapefile type, number of objects and its extents.
|
215
|
+
<br>
|
216
|
+
<b>Usage</b>: <font face="courier">shpinfo shp_file</font>
|
217
|
+
<br>
|
218
|
+
<ul>
|
219
|
+
<li><b>shp_file</b>: the name of an existing shapefile.</li>
|
220
|
+
</ul>
|
221
|
+
<b>Example</b>
|
222
|
+
<br>
|
223
|
+
<font face="courier">$ shpinfo testpolygon</font>
|
224
|
+
<br>
|
225
|
+
<pre>Info for testpolygon
|
226
|
+
Polygon(5), 1 Records in file
|
227
|
+
File Bounds: ( 100000, 6000000)
|
228
|
+
( 250000, 7000000)</pre>
|
229
|
+
<hr>
|
230
|
+
|
231
|
+
<h2><a name="shpcat">shpcat</a></h2>
|
232
|
+
<b>Purpose</b>: appends the content of a source shapefile into a destiny shapefile. Both files must be the same shapefile type.
|
233
|
+
<br>
|
234
|
+
<b>Usage</b>: <font face="courier">shpcat from_shpfile to_shpfile</font>
|
235
|
+
<br>
|
236
|
+
<ul>
|
237
|
+
<li><b>from_shpfile</b>: source shapefile</li>
|
238
|
+
<li><b>to_shpfile</b>: destiny shapefile</li>
|
239
|
+
</ul>
|
240
|
+
<b>Example</b>
|
241
|
+
<br>
|
242
|
+
<font face="courier">$ shpcat shapefile1 shapefile2</font>
|
243
|
+
<br>
|
244
|
+
<hr>
|
245
|
+
|
246
|
+
<h2><a name="shpcentrd">shpcentrd</a></h2>
|
247
|
+
<b>Purpose</b>: computes XY centroid for polygon shapefiles.
|
248
|
+
<br>
|
249
|
+
<b>Usage</b>: <font face="courier">shpcentrd shp_file new_shp_file</font>
|
250
|
+
<br>
|
251
|
+
<ul>
|
252
|
+
<li><b>shp_file</b>: the name of an existing polygon shapefile.</li>
|
253
|
+
<li><b>new_shp_file</b>: the name of the point shapefile that will created.</li>
|
254
|
+
</ul>
|
255
|
+
<b>Example</b>
|
256
|
+
<br>
|
257
|
+
<font face="courier">$ shpcentrd apolygonfile pointcentrd</font>
|
258
|
+
<br>
|
259
|
+
<hr>
|
260
|
+
|
261
|
+
<h2><a name="shpdxf">shpdxf</a></h2>
|
262
|
+
<b>Purpose</b>: creates a DXF file from an existing shapefile.
|
263
|
+
<br>
|
264
|
+
<b>Usage</b>: <font face="courier">shpdxf shapefile {idfield}</font>
|
265
|
+
<br>
|
266
|
+
<ul>
|
267
|
+
<li><b>shapefile</b>: the name of an existing shapefile.</li>
|
268
|
+
<li><b>idfield</b>: explain</li>
|
269
|
+
</ul>
|
270
|
+
<b>Example</b>
|
271
|
+
<br>
|
272
|
+
<font face="courier">$ shpdxf testshapefile IDFIELD</font>
|
273
|
+
<br># explain the command
|
274
|
+
<br>
|
275
|
+
<hr>
|
276
|
+
|
277
|
+
<h2><a name="shpfix">shpfix</a></h2>
|
278
|
+
<b>Purpose</b>: Utility program to fix nulls and inconsistencies in Shapefiles
|
279
|
+
as happens from time to time.
|
280
|
+
<br>
|
281
|
+
<b>Usage</b>: <font face="courier">shpfix shpfile new_file <Record# to Blank></font>
|
282
|
+
<br>
|
283
|
+
<ul>
|
284
|
+
<li><b>shpfile</b>: input file</li>
|
285
|
+
<li><b>new_file</b>: output file</li>
|
286
|
+
</ul>
|
287
|
+
<b>Example</b>
|
288
|
+
<br>
|
289
|
+
<font face="courier">$ shpfix broken fixed</font>
|
290
|
+
<br>
|
291
|
+
<hr>
|
292
|
+
|
293
|
+
<h2><a name="shpproj">shpproj</a></h2>
|
294
|
+
<b>Purpose</b>: Reproject Shapefiles using PROJ.4
|
295
|
+
<br>
|
296
|
+
<b>Usage</b>: <font face="courier">shpproj shp_file new_shp ( -i=in_proj_file | -i="in_params" | -i=geographic ) ( -o=out_info_file | -o="out_params" | -o=geographic ) </font>
|
297
|
+
<br>
|
298
|
+
<ul>
|
299
|
+
<li><b>param1</b>: explain</li>
|
300
|
+
<li><b>param2</b>: explain</li>
|
301
|
+
</ul>
|
302
|
+
<p>
|
303
|
+
|
304
|
+
<b>INPUT</b><br>
|
305
|
+
Input can come from one of three sources. A projection parameter file,
|
306
|
+
directly through parameters or geographic. If the shapefile has an associated
|
307
|
+
prj file, name the same as the shapefile but ending in ".prj" it will be used
|
308
|
+
by default ignoring all other parameters. If input is omitted it defaults to
|
309
|
+
geographic, unless the default prj file exists.<p>
|
310
|
+
|
311
|
+
<b>OUTPUT</b><br>
|
312
|
+
Output can come from one of three sources. A projection parameter file,
|
313
|
+
directly through parameters or geographic. If output is omitted it defaults
|
314
|
+
to geographic.<p>
|
315
|
+
|
316
|
+
<b>PROJECTION PARAMETER FILE</b><br>
|
317
|
+
This file MUST end with the extension ".prj". It has the form of one
|
318
|
+
projection parameter per line. Parameters can be in any order. The
|
319
|
+
projection parameters are those used to define a PROJ.4 projection.<p>
|
320
|
+
|
321
|
+
<b>PROJECTION PARAMETERS</b><br>
|
322
|
+
Are the same as used by proj and invproj.<p>
|
323
|
+
<pre>
|
324
|
+
use proj -lP to see available projections
|
325
|
+
proj -lu to see available units
|
326
|
+
proj -le to see available ellipsoid
|
327
|
+
</pre>
|
328
|
+
|
329
|
+
Or visit the PROJ.4 web page at <a href="http://www.remotesensing.org/proj">http://www.remotesensing.org/proj</a> for more details.<p>
|
330
|
+
|
331
|
+
<p>
|
332
|
+
|
333
|
+
<b>Example</b></br>
|
334
|
+
|
335
|
+
the following example projects file rowtest to row3, moving data from Stateplane NAD83 zone 1002 to utm zone 16 in meters<p>
|
336
|
+
|
337
|
+
<pre>
|
338
|
+
|
339
|
+
shpproj rowtest row -i="init=nad83:1002 units=us-ft" -o="proj=utm zone=16 units=m"
|
340
|
+
|
341
|
+
shpproj rowtest row3 -o="proj=utm zone=18 units=m" -i="zone=16 proj=utm units=us-ft"
|
342
|
+
|
343
|
+
shpproj rowtest row3 -o="proj=utm zone=18 units=m"
|
344
|
+
|
345
|
+
shpproj rowtest row3 -i=myfile.prj -o=geographic
|
346
|
+
shpproj rowtest row3 -is=myfile.prj
|
347
|
+
</pre>
|
348
|
+
|
349
|
+
<hr>
|
350
|
+
|
351
|
+
</body>
|
352
|
+
</html>
|