├── .gitignore
├── Builds
├── gtg-linux-386-32b-1.0.zip
├── gtg-mac-intel-0.1.zip
└── gtg-mac-intel-1.0.zip
├── Examples
├── Images
│ ├── 1.png
│ ├── 2.png
│ ├── 3.png
│ ├── 4.png
│ ├── 5.png
│ ├── 6.png
│ └── 7.png
├── Observer.dbf
├── Observer.prj
├── Observer.qpj
├── Observer.shp
├── Observer.shx
├── README.md
├── example1.dbf
├── example1.prj
├── example1.shp
├── example1.shx
├── example2.dbf
├── example2.prj
├── example2.shp
├── example2.shx
├── example3.dbf
├── example3.prj
├── example3.shp
├── example3.shx
├── example4.dbf
├── example4.prj
├── example4.shp
├── example4.shx
├── example5.dbf
├── example5.prj
├── example5.shp
├── example5.shx
├── example6.dbf
├── example6.prj
├── example6.shp
├── example6.shx
├── example7-unsplit.dbf
├── example7-unsplit.prj
├── example7-unsplit.shp
├── example7-unsplit.shx
├── example7.dbf
├── example7.prj
├── example7.shp
├── example7.shx
└── geoeye1.tle
├── LICENSE
├── Libraries
├── README.md
├── sgp4
│ ├── .hg_archival.txt
│ ├── .hgignore
│ ├── .hgtags
│ ├── AUTHORS
│ ├── COPYING
│ ├── ChangeLog
│ ├── INSTALL
│ ├── Makefile.am
│ ├── Makefile.in
│ ├── NEWS
│ ├── README
│ ├── SGP4-VER.TLE
│ ├── aclocal.m4
│ ├── autom4te.cache
│ │ ├── output.0
│ │ ├── output.1
│ │ ├── traces.0
│ │ └── traces.1
│ ├── configure
│ ├── configure.ac
│ ├── depcomp
│ ├── install-sh
│ ├── libsgp4
│ │ ├── .deps
│ │ │ ├── CoordGeodetic.Po
│ │ │ ├── CoordTopocentric.Po
│ │ │ ├── DateTime.Po
│ │ │ ├── Eci.Po
│ │ │ ├── Globals.Po
│ │ │ ├── Observer.Po
│ │ │ ├── OrbitalElements.Po
│ │ │ ├── SGP4.Po
│ │ │ ├── SolarPosition.Po
│ │ │ ├── TimeSpan.Po
│ │ │ ├── Tle.Po
│ │ │ ├── Util.Po
│ │ │ └── Vector.Po
│ │ ├── CoordGeodetic.cpp
│ │ ├── CoordGeodetic.h
│ │ ├── CoordTopocentric.cpp
│ │ ├── CoordTopocentric.h
│ │ ├── DateTime.cpp
│ │ ├── DateTime.h
│ │ ├── DecayedException.h
│ │ ├── Eci.cpp
│ │ ├── Eci.h
│ │ ├── Globals.cpp
│ │ ├── Globals.h
│ │ ├── Makefile.am
│ │ ├── Makefile.in
│ │ ├── Observer.cpp
│ │ ├── Observer.h
│ │ ├── OrbitalElements.cpp
│ │ ├── OrbitalElements.h
│ │ ├── SGP4.cpp
│ │ ├── SGP4.h
│ │ ├── SatelliteException.h
│ │ ├── SolarPosition.cpp
│ │ ├── SolarPosition.h
│ │ ├── TimeSpan.cpp
│ │ ├── TimeSpan.h
│ │ ├── Tle.cpp
│ │ ├── Tle.h
│ │ ├── TleException.h
│ │ ├── Util.cpp
│ │ ├── Util.h
│ │ ├── Vector.cpp
│ │ └── Vector.h
│ ├── missing
│ ├── passpredict
│ │ ├── .deps
│ │ │ └── passpredict.Po
│ │ ├── Makefile.am
│ │ ├── Makefile.in
│ │ └── passpredict.cpp
│ ├── runtest
│ │ ├── .deps
│ │ │ └── runtest.Po
│ │ ├── Makefile.am
│ │ ├── Makefile.in
│ │ ├── SGP4-VER.TLE
│ │ ├── runtest.cpp
│ │ └── runtest.out.txt
│ └── sattrack
│ │ ├── .deps
│ │ └── sattrack.Po
│ │ ├── Makefile.am
│ │ ├── Makefile.in
│ │ └── sattrack.cpp
└── shapelib
│ ├── .cvsignore
│ ├── ChangeLog
│ ├── HOWTO-RELEASE
│ ├── LICENSE.LGPL
│ ├── Makefile
│ ├── README
│ ├── README.tree
│ ├── contrib
│ ├── .cvsignore
│ ├── Makefile
│ ├── ShapeFileII.pas
│ ├── Shape_PointInPoly.cpp
│ ├── Shape_PointInPoly_README.txt
│ ├── csv2shp.c
│ ├── dbfcat.c
│ ├── dbfinfo.c
│ ├── doc
│ │ └── shpproj.txt
│ ├── makefile.vc
│ ├── my_nan.h
│ ├── shpcat.c
│ ├── shpcentrd.c
│ ├── shpdata.c
│ ├── shpdxf.c
│ ├── shpfix.c
│ ├── shpgeo.c
│ ├── shpgeo.h
│ ├── shpinfo.c
│ ├── shpproj.c
│ ├── shpsort.c
│ ├── shpsort.txt
│ ├── shpwkb.c
│ └── tests
│ │ └── shpproj.sh
│ ├── dbfadd.c
│ ├── dbfcreate.c
│ ├── dbfdump.c
│ ├── dbfopen.c
│ ├── makefile.vc
│ ├── makeshape.sh
│ ├── mkdist.sh
│ ├── mkinstalldirs
│ ├── mkrelease.sh
│ ├── safileio.c
│ ├── shapefil.h
│ ├── shapelib.def
│ ├── shpadd.c
│ ├── shpcreate.c
│ ├── shpdump.c
│ ├── shpopen.c
│ ├── shprewind.c
│ ├── shptest.c
│ ├── shptree.c
│ ├── shptreedump.c
│ ├── shputils.c
│ ├── stream1.out
│ ├── stream1.sh
│ ├── stream2.out
│ ├── stream2.sh
│ ├── stream3.out
│ └── web
│ ├── .cvsignore
│ ├── codepage.html
│ ├── dbf_api.html
│ ├── index.html
│ ├── license.html
│ ├── manifest.html
│ ├── release.html
│ ├── shapelib-tools.html
│ └── shp_api.html
├── Makefile
├── README.md
├── Source
├── Makefile
├── Usage.txt
├── gtg.cpp
├── gtg.h
├── gtgattr.cpp
├── gtgattr.h
├── gtgshp.cpp
├── gtgshp.h
├── gtgtle.cpp
├── gtgtle.h
├── gtgtrace.cpp
├── gtgtrace.h
├── gtgutil.cpp
└── gtgutil.h
└── test
├── cases
├── 10
│ ├── 10.tle
│ └── 10.txt
├── 11
│ ├── 11.tle
│ └── 11.txt
├── 12
│ ├── 12.tle
│ └── 12.txt
├── 13
│ ├── 13.tle
│ └── 13.txt
├── 14
│ ├── 14.tle
│ └── 14.txt
├── 15
│ ├── 15.tle
│ └── 15.txt
├── 16
│ ├── 16.tle
│ └── 16.txt
├── 17
│ ├── 17.tle
│ └── 17.txt
├── 18
│ ├── 18.tle
│ └── 18.txt
├── 19
│ ├── 19.tle
│ └── 19.txt
├── 20
│ ├── 20.tle
│ └── 20.txt
├── 21
│ ├── 21.tle
│ └── 21.txt
├── 22
│ ├── 22.tle
│ └── 22.txt
├── 23
│ ├── 23.tle
│ └── 23.txt
├── 24
│ ├── 24.tle
│ └── 24.txt
├── 25
│ ├── 25.tle
│ └── 25.txt
├── 26
│ ├── 26.tle
│ └── 26.txt
├── 27
│ ├── 27.tle
│ └── 27.txt
├── 28
│ ├── 28.tle
│ └── 28.txt
├── 29
│ ├── 29.tle
│ └── 29.txt
├── 30
│ ├── 30.lib.txt
│ ├── 30.rsr.txt
│ ├── 30.tle
│ └── 30.txt
├── 31
│ ├── 31.tle
│ └── 31.txt
├── 32
│ ├── 32.tle
│ └── 32.txt
├── 33
│ ├── 33.tle
│ └── 33.txt
├── 01
│ ├── 01.tle
│ └── 01.txt
├── 02
│ ├── 02.tle
│ └── 02.txt
├── 03
│ ├── 03.tle
│ └── 03.txt
├── 04
│ ├── 04.tle
│ └── 04.txt
├── 05
│ ├── 05.tle
│ └── 05.txt
├── 06
│ ├── 06.tle
│ └── 06.txt
├── 07
│ ├── 07.tle
│ └── 07.txt
├── 08
│ ├── 08.tle
│ └── 08.txt
├── 09
│ ├── 09.tle
│ └── 09.txt
├── Makefile
├── README.md
├── difftable.tcl
├── gtg-vs-reference.diff
├── librefdiff.txt
├── librsrdiff.txt
├── test-gtg.txt
├── test-library.txt
├── test-reference.txt
├── test-rsr.txt
└── test.tcl
├── images
├── README.md
├── comparison.png
├── elevation-trace.png
├── iss-orthographic.png
├── iss.png
├── iss2.png
└── ls83.png
├── iss.dbf
├── iss.shp
├── iss.shx
├── options
├── README.md
├── iss.tle
├── stations.tle
└── test.tcl
└── solar
├── Makefile
└── solarposition.cpp
/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore executable, intermediate object code, and libraries
2 | /gtg
3 | *.o
4 | *.a
5 |
6 | # Ignore test files unless explicitly added as examples
7 | /test
8 |
9 | # Ignore Reference directory (contains TLE/SGP4 documentation and papers)
10 | /Reference
11 |
12 | # Ignore OS litter
13 | .DS_Store
14 |
15 | # Ignore libsgp4 aclocal/automake/configure-specific files & settings
16 | /Libraries/sgp4/Makefile
17 | /Libraries/sgp4/autom4te.cache/requests
18 | /Libraries/sgp4/config.log
19 | /Libraries/sgp4/config.status
20 | /Libraries/sgp4/libsgp4/Makefile
21 | /Libraries/sgp4/passpredict/Makefile
22 | /Libraries/sgp4/runtest/Makefile
23 | /Libraries/sgp4/sattrack/Makefile
24 |
25 | # Ignore binary utilities built with libraries
26 | /Libraries/sgp4/passpredict/passpredict
27 | /Libraries/sgp4/runtest/runtest
28 | /Libraries/sgp4/sattrack/sattrack
29 | /Libraries/shapelib/dbfdump
30 |
--------------------------------------------------------------------------------
/Builds/gtg-linux-386-32b-1.0.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Builds/gtg-linux-386-32b-1.0.zip
--------------------------------------------------------------------------------
/Builds/gtg-mac-intel-0.1.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Builds/gtg-mac-intel-0.1.zip
--------------------------------------------------------------------------------
/Builds/gtg-mac-intel-1.0.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Builds/gtg-mac-intel-1.0.zip
--------------------------------------------------------------------------------
/Examples/Images/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Examples/Images/1.png
--------------------------------------------------------------------------------
/Examples/Images/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Examples/Images/2.png
--------------------------------------------------------------------------------
/Examples/Images/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Examples/Images/3.png
--------------------------------------------------------------------------------
/Examples/Images/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Examples/Images/4.png
--------------------------------------------------------------------------------
/Examples/Images/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Examples/Images/5.png
--------------------------------------------------------------------------------
/Examples/Images/6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Examples/Images/6.png
--------------------------------------------------------------------------------
/Examples/Images/7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Examples/Images/7.png
--------------------------------------------------------------------------------
/Examples/Observer.dbf:
--------------------------------------------------------------------------------
1 | _ a 1 W LAT N LON N
42.102221999999998 -75.911666999999994
--------------------------------------------------------------------------------
/Examples/Observer.prj:
--------------------------------------------------------------------------------
1 | PROJCS["WGS_84_World_Mercator",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Mercator"],PARAMETER["central_meridian",0],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1],PARAMETER["standard_parallel_1",0.0]]
--------------------------------------------------------------------------------
/Examples/Observer.qpj:
--------------------------------------------------------------------------------
1 | PROJCS["WGS 84 / World Mercator",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Mercator_1SP"],PARAMETER["central_meridian",0],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","3395"]]
2 |
--------------------------------------------------------------------------------
/Examples/Observer.shp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Examples/Observer.shp
--------------------------------------------------------------------------------
/Examples/Observer.shx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Examples/Observer.shx
--------------------------------------------------------------------------------
/Examples/example1.dbf:
--------------------------------------------------------------------------------
1 | _ A W FID N
2 |
0
--------------------------------------------------------------------------------
/Examples/example1.prj:
--------------------------------------------------------------------------------
1 | GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["WGS 72",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4322"]]
2 |
--------------------------------------------------------------------------------
/Examples/example1.shp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Examples/example1.shp
--------------------------------------------------------------------------------
/Examples/example1.shx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Examples/example1.shx
--------------------------------------------------------------------------------
/Examples/example2.dbf:
--------------------------------------------------------------------------------
1 | _Z A W FID N
2 |
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
--------------------------------------------------------------------------------
/Examples/example2.prj:
--------------------------------------------------------------------------------
1 | GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["WGS 72",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4322"]]
2 |
--------------------------------------------------------------------------------
/Examples/example2.shp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Examples/example2.shp
--------------------------------------------------------------------------------
/Examples/example2.shx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Examples/example2.shx
--------------------------------------------------------------------------------
/Examples/example3.dbf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Examples/example3.dbf
--------------------------------------------------------------------------------
/Examples/example3.prj:
--------------------------------------------------------------------------------
1 | GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["WGS 72",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4322"]]
2 |
--------------------------------------------------------------------------------
/Examples/example3.shp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Examples/example3.shp
--------------------------------------------------------------------------------
/Examples/example3.shx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Examples/example3.shx
--------------------------------------------------------------------------------
/Examples/example4.dbf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Examples/example4.dbf
--------------------------------------------------------------------------------
/Examples/example4.prj:
--------------------------------------------------------------------------------
1 | GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["WGS 72",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4322"]]
2 |
--------------------------------------------------------------------------------
/Examples/example4.shp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Examples/example4.shp
--------------------------------------------------------------------------------
/Examples/example4.shx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Examples/example4.shx
--------------------------------------------------------------------------------
/Examples/example5.dbf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Examples/example5.dbf
--------------------------------------------------------------------------------
/Examples/example5.prj:
--------------------------------------------------------------------------------
1 | GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["WGS 72",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4322"]]
2 |
--------------------------------------------------------------------------------
/Examples/example5.shp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Examples/example5.shp
--------------------------------------------------------------------------------
/Examples/example5.shx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Examples/example5.shx
--------------------------------------------------------------------------------
/Examples/example6.dbf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Examples/example6.dbf
--------------------------------------------------------------------------------
/Examples/example6.prj:
--------------------------------------------------------------------------------
1 | GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["WGS 72",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4322"]]
2 |
--------------------------------------------------------------------------------
/Examples/example6.shp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Examples/example6.shp
--------------------------------------------------------------------------------
/Examples/example6.shx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Examples/example6.shx
--------------------------------------------------------------------------------
/Examples/example7-unsplit.dbf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Examples/example7-unsplit.dbf
--------------------------------------------------------------------------------
/Examples/example7-unsplit.prj:
--------------------------------------------------------------------------------
1 | GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["WGS 72",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4322"]]
2 |
--------------------------------------------------------------------------------
/Examples/example7-unsplit.shp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Examples/example7-unsplit.shp
--------------------------------------------------------------------------------
/Examples/example7-unsplit.shx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Examples/example7-unsplit.shx
--------------------------------------------------------------------------------
/Examples/example7.dbf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Examples/example7.dbf
--------------------------------------------------------------------------------
/Examples/example7.prj:
--------------------------------------------------------------------------------
1 | GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["WGS 72",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4322"]]
2 |
--------------------------------------------------------------------------------
/Examples/example7.shp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Examples/example7.shp
--------------------------------------------------------------------------------
/Examples/example7.shx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Examples/example7.shx
--------------------------------------------------------------------------------
/Examples/geoeye1.tle:
--------------------------------------------------------------------------------
1 | GEOEYE 1
2 | 1 33331U 08042A 12091.09077403 .00000328 00000-0 70846-4 0 9565
3 | 2 33331 98.1132 165.3484 0011197 115.0161 245.2220 14.64451624190457
4 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2012 Jim DeVona
2 |
3 | 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:
4 |
5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6 |
7 | 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.
8 |
--------------------------------------------------------------------------------
/Libraries/README.md:
--------------------------------------------------------------------------------
1 | # Libraries
2 |
3 | Ground Track Generator has two external dependencies: [Shapelib](http://shapelib.maptools.org/) and Dan Warner's [C++ SGP4 Satellite Library](http://www.danrw.com/sgp4-satellite.php).
4 |
5 | ## Shapelib
6 |
7 | 1. Go to and download from
8 | 2. Unzip the archive; rename the directory `shapelib` and put it in this directory.
9 |
10 | ## Dan Warner's C++ SGP4 Satellite Library
11 |
12 | 1. Go to and download
13 | 2. Unzip the archive; rename the directory `sgp4` and put it in this directory.
14 |
15 | Note that it may be necessary to [re-]run `aclocal`, `automake`, and `./configure` in `sgp4` before it can be built with `make`.
16 |
--------------------------------------------------------------------------------
/Libraries/sgp4/.hg_archival.txt:
--------------------------------------------------------------------------------
1 | repo: 2e03ee3ea61cfd974f0a00b281e117f8e7afb60f
2 | node: 94c5f78b9e4071ce228f23b8f46bb34d951f3f94
3 | branch: default
4 | latesttag: v1.0
5 | latesttagdistance: 10
6 |
--------------------------------------------------------------------------------
/Libraries/sgp4/.hgignore:
--------------------------------------------------------------------------------
1 | # Exact paths to config junk
2 | ^config.(h|log|status|guess|sub)$
3 |
4 | # Build artifacts
5 | ^libsgp4/libsgp4.a$
6 | ^passpredict/passpredict$
7 | ^runtest/runtest$
8 | ^sattrack/sattrack$
9 | .(deps|libs)/*$
10 | .cmp$
11 | autom4te.cache/*$
12 | doxygen/*$
13 |
14 | Makefile(.in)?$
15 | .(deps|libs)$
16 | \.l?o$
17 |
18 | # Merged files
19 | \.orig$
20 |
21 | # Backup files
22 | .*~$
23 |
--------------------------------------------------------------------------------
/Libraries/sgp4/.hgtags:
--------------------------------------------------------------------------------
1 | 85e07bf8b43e0e1312fdb6e288bf08b5b3b017be v1.0
2 |
--------------------------------------------------------------------------------
/Libraries/sgp4/AUTHORS:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Libraries/sgp4/AUTHORS
--------------------------------------------------------------------------------
/Libraries/sgp4/ChangeLog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Libraries/sgp4/ChangeLog
--------------------------------------------------------------------------------
/Libraries/sgp4/Makefile.am:
--------------------------------------------------------------------------------
1 | SUBDIRS = libsgp4 sattrack runtest passpredict
2 |
--------------------------------------------------------------------------------
/Libraries/sgp4/NEWS:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Libraries/sgp4/NEWS
--------------------------------------------------------------------------------
/Libraries/sgp4/README:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Libraries/sgp4/README
--------------------------------------------------------------------------------
/Libraries/sgp4/configure.ac:
--------------------------------------------------------------------------------
1 | AC_PREREQ([2.61])
2 | AC_INIT([sgp4], 1.0, [info@danrw.com])
3 | AM_INIT_AUTOMAKE
4 | AM_SILENT_RULES([yes])
5 |
6 | AC_CONFIG_SRCDIR([libsgp4/Tle.cpp])
7 |
8 | CFLAGS=" $CFLAGS"
9 | CXXFLAGS=" $CXXFLAGS"
10 |
11 | AC_PROG_RANLIB
12 | AC_PROG_CXX
13 |
14 | AC_ARG_ENABLE(debug,
15 | AC_HELP_STRING([--enable-debug],
16 | [build debug library (default=no)])
17 | ,
18 | ,
19 | enable_debug=no)
20 |
21 | if test x$enable_debug = xyes; then
22 | AM_CXXFLAGS="-g -O0 -Werror -Wextra -W -Wall -Wconversion"
23 | else
24 | AM_CXXFLAGS="-DNDEBUG -O2 -fomit-frame-pointer -Wextra -Werror -W -Wall -Wconversion"
25 | fi
26 |
27 | AC_SEARCH_LIBS([clock_gettime],
28 | [rt],
29 | [AC_DEFINE(HAVE_CLOCK_GETTIME,
30 | [1],
31 | [Define if clock_gettime is available.])])
32 |
33 | AC_SUBST(AM_CXXFLAGS)
34 |
35 | AC_CONFIG_FILES([Makefile
36 | libsgp4/Makefile
37 | passpredict/Makefile
38 | runtest/Makefile
39 | sattrack/Makefile])
40 |
41 | AC_OUTPUT
42 | echo "---"
43 | echo "Configuration summary for $PACKAGE_NAME version $VERSION"
44 | echo ""
45 | echo " * Installation prefix: $prefix"
46 | echo " * System type: $build_vendor-$build_os"
47 | echo " * Host CPU: $build_cpu"
48 | echo " C Compiler: ${CC}"
49 | echo " C++ Compiler: ${CXX}"
50 | echo " Compiler flags: ${AM_CXXFLAGS}"
51 | echo " Linker flags: ${AM_LDFLAGS}"
52 | echo " Libraries: ${LIBS}"
53 | echo " Debug enabled: $enable_debug"
54 | echo ""
55 | echo "---"
56 |
--------------------------------------------------------------------------------
/Libraries/sgp4/libsgp4/.deps/Globals.Po:
--------------------------------------------------------------------------------
1 | Globals.o: Globals.cpp Globals.h /usr/include/c++/4.7/cmath \
2 | /usr/include/c++/4.7/i686-linux-gnu/bits/c++config.h \
3 | /usr/include/c++/4.7/i686-linux-gnu/bits/os_defines.h \
4 | /usr/include/features.h /usr/include/i386-linux-gnu/bits/predefs.h \
5 | /usr/include/i386-linux-gnu/sys/cdefs.h \
6 | /usr/include/i386-linux-gnu/bits/wordsize.h \
7 | /usr/include/i386-linux-gnu/gnu/stubs.h \
8 | /usr/include/i386-linux-gnu/gnu/stubs-32.h \
9 | /usr/include/c++/4.7/i686-linux-gnu/bits/cpu_defines.h \
10 | /usr/include/c++/4.7/bits/cpp_type_traits.h \
11 | /usr/include/c++/4.7/ext/type_traits.h /usr/include/math.h \
12 | /usr/include/i386-linux-gnu/bits/huge_val.h \
13 | /usr/include/i386-linux-gnu/bits/huge_valf.h \
14 | /usr/include/i386-linux-gnu/bits/huge_vall.h \
15 | /usr/include/i386-linux-gnu/bits/inf.h \
16 | /usr/include/i386-linux-gnu/bits/nan.h \
17 | /usr/include/i386-linux-gnu/bits/mathdef.h \
18 | /usr/include/i386-linux-gnu/bits/mathcalls.h \
19 | /usr/include/i386-linux-gnu/bits/mathinline.h
20 |
21 | Globals.h:
22 |
23 | /usr/include/c++/4.7/cmath:
24 |
25 | /usr/include/c++/4.7/i686-linux-gnu/bits/c++config.h:
26 |
27 | /usr/include/c++/4.7/i686-linux-gnu/bits/os_defines.h:
28 |
29 | /usr/include/features.h:
30 |
31 | /usr/include/i386-linux-gnu/bits/predefs.h:
32 |
33 | /usr/include/i386-linux-gnu/sys/cdefs.h:
34 |
35 | /usr/include/i386-linux-gnu/bits/wordsize.h:
36 |
37 | /usr/include/i386-linux-gnu/gnu/stubs.h:
38 |
39 | /usr/include/i386-linux-gnu/gnu/stubs-32.h:
40 |
41 | /usr/include/c++/4.7/i686-linux-gnu/bits/cpu_defines.h:
42 |
43 | /usr/include/c++/4.7/bits/cpp_type_traits.h:
44 |
45 | /usr/include/c++/4.7/ext/type_traits.h:
46 |
47 | /usr/include/math.h:
48 |
49 | /usr/include/i386-linux-gnu/bits/huge_val.h:
50 |
51 | /usr/include/i386-linux-gnu/bits/huge_valf.h:
52 |
53 | /usr/include/i386-linux-gnu/bits/huge_vall.h:
54 |
55 | /usr/include/i386-linux-gnu/bits/inf.h:
56 |
57 | /usr/include/i386-linux-gnu/bits/nan.h:
58 |
59 | /usr/include/i386-linux-gnu/bits/mathdef.h:
60 |
61 | /usr/include/i386-linux-gnu/bits/mathcalls.h:
62 |
63 | /usr/include/i386-linux-gnu/bits/mathinline.h:
64 |
--------------------------------------------------------------------------------
/Libraries/sgp4/libsgp4/CoordGeodetic.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Daniel Warner
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 |
18 | #include "CoordGeodetic.h"
19 |
--------------------------------------------------------------------------------
/Libraries/sgp4/libsgp4/CoordTopocentric.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Daniel Warner
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 |
18 | #include "CoordTopocentric.h"
19 |
--------------------------------------------------------------------------------
/Libraries/sgp4/libsgp4/DecayedException.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Daniel Warner
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 |
18 | #ifndef DECAYEDEXCEPTION_H_
19 | #define DECAYEDEXCEPTION_H_
20 |
21 | #include "DateTime.h"
22 | #include "Vector.h"
23 |
24 | #include
25 |
26 | /**
27 | * @brief The exception that the SGP4 class throws when a satellite decays.
28 | */
29 | class DecayedException : public std::exception
30 | {
31 | public:
32 | /**
33 | * Constructor
34 | * @param[in] dt time of the event
35 | * @param[in] pos position of the satellite at dt
36 | * @param[in] vel velocity of the satellite at dt
37 | */
38 | DecayedException(const DateTime& dt, const Vector& pos, const Vector& vel)
39 | : _dt(dt), _pos(pos), _vel(vel)
40 | {
41 | }
42 |
43 | /**
44 | * Destructor
45 | */
46 | virtual ~DecayedException(void) throw ()
47 | {
48 | }
49 |
50 | /**
51 | * @returns the error string
52 | */
53 | virtual const char* what() const throw ()
54 | {
55 | return "Error: Satellite decayed";
56 | }
57 |
58 | /**
59 | * @returns the date
60 | */
61 | DateTime Decayed() const
62 | {
63 | return _dt;
64 | }
65 |
66 | /**
67 | * @returns the position
68 | */
69 | Vector Position() const
70 | {
71 | return _pos;
72 | }
73 |
74 | /**
75 | * @returns the velocity
76 | */
77 | Vector Velocity() const
78 | {
79 | return _vel;
80 | }
81 |
82 | private:
83 | DateTime _dt;
84 | Vector _pos;
85 | Vector _vel;
86 | };
87 |
88 | #endif
89 |
--------------------------------------------------------------------------------
/Libraries/sgp4/libsgp4/Eci.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Daniel Warner
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 |
18 | #include "Eci.h"
19 |
20 | #include "Globals.h"
21 | #include "Util.h"
22 |
23 | /**
24 | * Converts a DateTime and Geodetic position to Eci coordinates
25 | * @param[in] dt the date
26 | * @param[in] geo the geodetic position
27 | */
28 | void Eci::ToEci(const DateTime& dt, const CoordGeodetic &geo)
29 | {
30 | /*
31 | * set date
32 | */
33 | m_dt = dt;
34 |
35 | static const double mfactor = kTWOPI * (kOMEGA_E / kSECONDS_PER_DAY);
36 |
37 | /*
38 | * Calculate Local Mean Sidereal Time for observers longitude
39 | */
40 | const double theta = m_dt.ToLocalMeanSiderealTime(geo.longitude);
41 |
42 | /*
43 | * take into account earth flattening
44 | */
45 | const double c = 1.0
46 | / sqrt(1.0 + kF * (kF - 2.0) * pow(sin(geo.latitude), 2.0));
47 | const double s = pow(1.0 - kF, 2.0) * c;
48 | const double achcp = (kXKMPER * c + geo.altitude) * cos(geo.latitude);
49 |
50 | /*
51 | * X position in km
52 | * Y position in km
53 | * Z position in km
54 | * W magnitude in km
55 | */
56 | m_position.x = achcp * cos(theta);
57 | m_position.y = achcp * sin(theta);
58 | m_position.z = (kXKMPER * s + geo.altitude) * sin(geo.latitude);
59 | m_position.w = m_position.Magnitude();
60 |
61 | /*
62 | * X velocity in km/s
63 | * Y velocity in km/s
64 | * Z velocity in km/s
65 | * W magnitude in km/s
66 | */
67 | m_velocity.x = -mfactor * m_position.y;
68 | m_velocity.y = mfactor * m_position.x;
69 | m_velocity.z = 0.0;
70 | m_velocity.w = m_velocity.Magnitude();
71 | }
72 |
73 | /**
74 | * @returns the position in geodetic form
75 | */
76 | CoordGeodetic Eci::ToGeodetic() const
77 | {
78 | const double theta = Util::AcTan(m_position.y, m_position.x);
79 |
80 | const double lon = Util::WrapNegPosPI(theta
81 | - m_dt.ToGreenwichSiderealTime());
82 |
83 | const double r = sqrt((m_position.x * m_position.x)
84 | + (m_position.y * m_position.y));
85 |
86 | static const double e2 = kF * (2.0 - kF);
87 |
88 | double lat = Util::AcTan(m_position.z, r);
89 | double phi = 0.0;
90 | double c = 0.0;
91 | int cnt = 0;
92 |
93 | do
94 | {
95 | phi = lat;
96 | const double sinphi = sin(phi);
97 | c = 1.0 / sqrt(1.0 - e2 * sinphi * sinphi);
98 | lat = Util::AcTan(m_position.z + kXKMPER * c * e2 * sinphi, r);
99 | cnt++;
100 | }
101 | while (fabs(lat - phi) >= 1e-10 && cnt < 10);
102 |
103 | const double alt = r / cos(lat) - kXKMPER * c;
104 |
105 | return CoordGeodetic(lat, lon, alt, true);
106 | }
107 |
--------------------------------------------------------------------------------
/Libraries/sgp4/libsgp4/Eci.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Daniel Warner
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 |
18 | #ifndef ECI_H_
19 | #define ECI_H_
20 |
21 | #include "CoordGeodetic.h"
22 | #include "Vector.h"
23 | #include "DateTime.h"
24 |
25 | /**
26 | * @brief Stores an Earth-centered inertial position for a particular time.
27 | */
28 | class Eci
29 | {
30 | public:
31 |
32 | /**
33 | * @param[in] dt the date to be used for this position
34 | * @param[in] latitude the latitude in degrees
35 | * @param[in] longitude the longitude in degrees
36 | * @param[in] altitude the altitude in kilometers
37 | */
38 | Eci(const DateTime& dt,
39 | const double latitude,
40 | const double longitude,
41 | const double altitude)
42 | {
43 | ToEci(dt, CoordGeodetic(latitude, longitude, altitude));
44 | }
45 |
46 | /**
47 | * @param[in] dt the date to be used for this position
48 | * @param[in] geo the position
49 | */
50 | Eci(const DateTime& dt, const CoordGeodetic& geo)
51 | {
52 | ToEci(dt, geo);
53 | }
54 |
55 | /**
56 | * @param[in] dt the date to be used for this position
57 | * @param[in] position
58 | */
59 | Eci(const DateTime &dt, const Vector &position)
60 | : m_dt(dt),
61 | m_position(position)
62 | {
63 | }
64 |
65 | /**
66 | * @param[in] dt the date to be used for this position
67 | * @param[in] position the position
68 | * @param[in] velocity the velocity
69 | */
70 | Eci(const DateTime &dt, const Vector &position, const Vector &velocity)
71 | : m_dt(dt),
72 | m_position(position),
73 | m_velocity(velocity)
74 | {
75 | }
76 |
77 | /**
78 | * Destructor
79 | */
80 | virtual ~Eci()
81 | {
82 | }
83 |
84 | /**
85 | * Equality operator
86 | * @param dt the date to compare
87 | * @returns true if the object matches
88 | */
89 | bool operator==(const DateTime& dt) const
90 | {
91 | return m_dt == dt;
92 | }
93 |
94 | /**
95 | * Inequality operator
96 | * @param dt the date to compare
97 | * @returns true if the object doesn't match
98 | */
99 | bool operator!=(const DateTime& dt) const
100 | {
101 | return m_dt != dt;
102 | }
103 |
104 | /**
105 | * Update this object with a new date and geodetic position
106 | * @param dt new date
107 | * @param geo new geodetic position
108 | */
109 | void Update(const DateTime& dt, const CoordGeodetic& geo)
110 | {
111 | ToEci(dt, geo);
112 | }
113 |
114 | /**
115 | * @returns the position
116 | */
117 | Vector Position() const
118 | {
119 | return m_position;
120 | }
121 |
122 | /**
123 | * @returns the velocity
124 | */
125 | Vector Velocity() const
126 | {
127 | return m_velocity;
128 | }
129 |
130 | /**
131 | * @returns the date
132 | */
133 | DateTime GetDateTime() const
134 | {
135 | return m_dt;
136 | }
137 |
138 | /**
139 | * @returns the position in geodetic form
140 | */
141 | CoordGeodetic ToGeodetic() const;
142 |
143 | private:
144 | void ToEci(const DateTime& dt, const CoordGeodetic& geo);
145 |
146 | DateTime m_dt;
147 | Vector m_position;
148 | Vector m_velocity;
149 | };
150 |
151 | #endif
152 |
--------------------------------------------------------------------------------
/Libraries/sgp4/libsgp4/Globals.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Daniel Warner
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 |
18 | #include "Globals.h"
19 |
--------------------------------------------------------------------------------
/Libraries/sgp4/libsgp4/Globals.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Daniel Warner
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 |
18 | #ifndef GLOBALS_H_
19 | #define GLOBALS_H_
20 |
21 | #include
22 |
23 | const double kAE = 1.0;
24 | const double kQ0 = 120.0;
25 | const double kS0 = 78.0;
26 | const double kMU = 398600.8;
27 | const double kXKMPER = 6378.135;
28 | const double kXJ2 = 1.082616e-3;
29 | const double kXJ3 = -2.53881e-6;
30 | const double kXJ4 = -1.65597e-6;
31 |
32 | /*
33 | * alternative XKE
34 | * affects final results
35 | * aiaa-2006-6573
36 | * const double kXKE = 60.0 / sqrt(kXKMPER * kXKMPER * kXKMPER / kMU);
37 | * dundee
38 | * const double kXKE = 7.43669161331734132e-2;
39 | */
40 | const double kXKE = 60.0 / sqrt(kXKMPER * kXKMPER * kXKMPER / kMU);
41 | const double kCK2 = 0.5 * kXJ2 * kAE * kAE;
42 | const double kCK4 = -0.375 * kXJ4 * kAE * kAE * kAE * kAE;
43 |
44 | /*
45 | * alternative QOMS2T
46 | * affects final results
47 | * aiaa-2006-6573
48 | * #define QOMS2T (pow(((Q0 - S0) / XKMPER), 4.0))
49 | * dundee
50 | * #define QOMS2T (1.880279159015270643865e-9)
51 | */
52 | const double kQOMS2T = pow(((kQ0 - kS0) / kXKMPER), 4.0);
53 |
54 | const double kS = kAE * (1.0 + kS0 / kXKMPER);
55 | const double kPI = 3.14159265358979323846264338327950288419716939937510582;
56 | const double kTWOPI = 2.0 * kPI;
57 | const double kTWOTHIRD = 2.0 / 3.0;
58 | const double kTHDT = 4.37526908801129966e-3;
59 | /*
60 | * earth flattening
61 | */
62 | const double kF = 1.0 / 298.26;
63 | /*
64 | * earth rotation per sideral day
65 | */
66 | const double kOMEGA_E = 1.00273790934;
67 | const double kAU = 1.49597870691e8;
68 |
69 | const double kSECONDS_PER_DAY = 86400.0;
70 | const double kMINUTES_PER_DAY = 1440.0;
71 | const double kHOURS_PER_DAY = 24.0;
72 |
73 | // Jan 1.0 1900 = Jan 1 1900 00h UTC
74 | const double kEPOCH_JAN1_00H_1900 = 2415019.5;
75 |
76 | // Jan 1.5 1900 = Jan 1 1900 12h UTC
77 | const double kEPOCH_JAN1_12H_1900 = 2415020.0;
78 |
79 | // Jan 1.5 2000 = Jan 1 2000 12h UTC
80 | const double kEPOCH_JAN1_12H_2000 = 2451545.0;
81 |
82 | #endif
83 |
84 |
--------------------------------------------------------------------------------
/Libraries/sgp4/libsgp4/Makefile.am:
--------------------------------------------------------------------------------
1 | lib_LIBRARIES = libsgp4.a
2 | libsgp4_a_SOURCES = \
3 | CoordGeodetic.cpp \
4 | CoordTopocentric.cpp \
5 | DateTime.cpp \
6 | Eci.cpp \
7 | Globals.cpp \
8 | Observer.cpp \
9 | OrbitalElements.cpp \
10 | SGP4.cpp \
11 | SolarPosition.cpp \
12 | TimeSpan.cpp \
13 | Tle.cpp \
14 | Util.cpp \
15 | Vector.cpp
16 | include_HEADERS = CoordGeodetic.h \
17 | Eci.h \
18 | OrbitalElements.h \
19 | SatelliteException.h \
20 | TleException.h \
21 | Vector.h \
22 | CoordTopocentric.h \
23 | Globals.h \
24 | Observer.h \
25 | SGP4.h \
26 | SolarPosition.h \
27 | Tle.h \
28 | Util.h \
29 | TimeSpan.h \
30 | DateTime.h
31 |
--------------------------------------------------------------------------------
/Libraries/sgp4/libsgp4/Observer.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Daniel Warner
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 |
18 | #include "Observer.h"
19 |
20 | #include "CoordTopocentric.h"
21 |
22 | /*
23 | * calculate lookangle between the observer and the passed in Eci object
24 | */
25 | CoordTopocentric Observer::GetLookAngle(const Eci &eci)
26 | {
27 | /*
28 | * update the observers Eci to match the time of the Eci passed in
29 | * if necessary
30 | */
31 | Update(eci.GetDateTime());
32 |
33 | /*
34 | * calculate differences
35 | */
36 | Vector range_rate = eci.Velocity() - m_eci.Velocity();
37 | Vector range = eci.Position() - m_eci.Position();
38 |
39 | range.w = range.Magnitude();
40 |
41 | /*
42 | * Calculate Local Mean Sidereal Time for observers longitude
43 | */
44 | double theta = eci.GetDateTime().ToLocalMeanSiderealTime(m_geo.longitude);
45 |
46 | double sin_lat = sin(m_geo.latitude);
47 | double cos_lat = cos(m_geo.latitude);
48 | double sin_theta = sin(theta);
49 | double cos_theta = cos(theta);
50 |
51 | double top_s = sin_lat * cos_theta * range.x
52 | + sin_lat * sin_theta * range.y - cos_lat * range.z;
53 | double top_e = -sin_theta * range.x
54 | + cos_theta * range.y;
55 | double top_z = cos_lat * cos_theta * range.x
56 | + cos_lat * sin_theta * range.y + sin_lat * range.z;
57 | double az = atan(-top_e / top_s);
58 |
59 | if (top_s > 0.0)
60 | {
61 | az += kPI;
62 | }
63 |
64 | if (az < 0.0)
65 | {
66 | az += 2.0 * kPI;
67 | }
68 |
69 | double el = asin(top_z / range.w);
70 | double rate = range.Dot(range_rate) / range.w;
71 |
72 | /*
73 | * azimuth in radians
74 | * elevation in radians
75 | * range in km
76 | * range rate in km/s
77 | */
78 | return CoordTopocentric(az,
79 | el,
80 | range.w,
81 | rate);
82 | }
83 |
--------------------------------------------------------------------------------
/Libraries/sgp4/libsgp4/Observer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Daniel Warner
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 |
18 | #ifndef OBSERVER_H_
19 | #define OBSERVER_H_
20 |
21 | #include "CoordGeodetic.h"
22 | #include "Eci.h"
23 |
24 | class DateTime;
25 | class CoordTopocentric;
26 |
27 | /**
28 | * @brief Stores an observers location in Eci coordinates.
29 | */
30 | class Observer
31 | {
32 | public:
33 | /**
34 | * Constructor
35 | * @param[in] latitude observers latitude in degrees
36 | * @param[in] longitude observers longitude in degrees
37 | * @param[in] altitude observers altitude in kilometers
38 | */
39 | Observer(const double latitude,
40 | const double longitude,
41 | const double altitude)
42 | : m_geo(latitude, longitude, altitude),
43 | m_eci(DateTime(), m_geo)
44 | {
45 | }
46 |
47 | /**
48 | * Constructor
49 | * @param[in] geo the observers position
50 | */
51 | Observer(const CoordGeodetic &geo)
52 | : m_geo(geo),
53 | m_eci(DateTime(), geo)
54 | {
55 | }
56 |
57 | /**
58 | * Destructor
59 | */
60 | virtual ~Observer()
61 | {
62 | }
63 |
64 | /**
65 | * Set the observers location
66 | * @param[in] geo the observers position
67 | */
68 | void SetLocation(const CoordGeodetic& geo)
69 | {
70 | m_geo = geo;
71 | m_eci.Update(m_eci.GetDateTime(), m_geo);
72 | }
73 |
74 | /**
75 | * Get the observers location
76 | * @returns the observers position
77 | */
78 | CoordGeodetic GetLocation() const
79 | {
80 | return m_geo;
81 | }
82 |
83 | /**
84 | * Get the look angle for the observers position to the object
85 | * @param[in] eci the object to find the look angle to
86 | * @returns the lookup angle
87 | */
88 | CoordTopocentric GetLookAngle(const Eci &eci);
89 |
90 | private:
91 | /**
92 | * @param[in] dt the date to update the observers position for
93 | */
94 | void Update(const DateTime &dt)
95 | {
96 | if (m_eci != dt)
97 | {
98 | m_eci.Update(dt, m_geo);
99 | }
100 | }
101 |
102 | /** the observers position */
103 | CoordGeodetic m_geo;
104 | /** the observers Eci for a particular time */
105 | Eci m_eci;
106 | };
107 |
108 | #endif
109 |
110 |
--------------------------------------------------------------------------------
/Libraries/sgp4/libsgp4/OrbitalElements.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Daniel Warner
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 |
18 | #include "OrbitalElements.h"
19 |
20 | #include "Tle.h"
21 |
22 | OrbitalElements::OrbitalElements(const Tle& tle)
23 | {
24 | /*
25 | * extract and format tle data
26 | */
27 | mean_anomoly_ = tle.MeanAnomaly(false);
28 | ascending_node_ = tle.RightAscendingNode(false);
29 | argument_perigee_ = tle.ArgumentPerigee(false);
30 | eccentricity_ = tle.Eccentricity();
31 | inclination_ = tle.Inclination(false);
32 | mean_motion_ = tle.MeanMotion() * kTWOPI / kMINUTES_PER_DAY;
33 | bstar_ = tle.BStar();
34 | epoch_ = tle.Epoch();
35 |
36 | /*
37 | * recover original mean motion (xnodp) and semimajor axis (aodp)
38 | * from input elements
39 | */
40 | const double a1 = pow(kXKE / MeanMotion(), kTWOTHIRD);
41 | const double cosio = cos(Inclination());
42 | const double theta2 = cosio * cosio;
43 | const double x3thm1 = 3.0 * theta2 - 1.0;
44 | const double eosq = Eccentricity() * Eccentricity();
45 | const double betao2 = 1.0 - eosq;
46 | const double betao = sqrt(betao2);
47 | const double temp = (1.5 * kCK2) * x3thm1 / (betao * betao2);
48 | const double del1 = temp / (a1 * a1);
49 | const double a0 = a1 * (1.0 - del1 * (1.0 / 3.0 + del1 * (1.0 + del1 * 134.0 / 81.0)));
50 | const double del0 = temp / (a0 * a0);
51 |
52 | recovered_mean_motion_ = MeanMotion() / (1.0 + del0);
53 | /*
54 | * alternative way to calculate
55 | * doesnt affect final results
56 | * recovered_semi_major_axis_ = pow(XKE / RecoveredMeanMotion(), TWOTHIRD);
57 | */
58 | recovered_semi_major_axis_ = a0 / (1.0 - del0);
59 |
60 | /*
61 | * find perigee and period
62 | */
63 | perigee_ = (RecoveredSemiMajorAxis() * (1.0 - Eccentricity()) - kAE) * kXKMPER;
64 | period_ = kTWOPI / RecoveredMeanMotion();
65 | }
66 |
67 |
--------------------------------------------------------------------------------
/Libraries/sgp4/libsgp4/OrbitalElements.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Daniel Warner
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 |
18 | #ifndef ORBITALELEMENTS_H_
19 | #define ORBITALELEMENTS_H_
20 |
21 | #include "Util.h"
22 | #include "DateTime.h"
23 |
24 | class Tle;
25 |
26 | /**
27 | * @brief The extracted orbital elements used by the SGP4 propagator.
28 | */
29 | class OrbitalElements
30 | {
31 | public:
32 | OrbitalElements(const Tle& tle);
33 |
34 | virtual ~OrbitalElements()
35 | {
36 | }
37 |
38 | /*
39 | * XMO
40 | */
41 | double MeanAnomoly() const
42 | {
43 | return mean_anomoly_;
44 | }
45 |
46 | /*
47 | * XNODEO
48 | */
49 | double AscendingNode() const
50 | {
51 | return ascending_node_;
52 | }
53 |
54 | /*
55 | * OMEGAO
56 | */
57 | double ArgumentPerigee() const
58 | {
59 | return argument_perigee_;
60 | }
61 |
62 | /*
63 | * EO
64 | */
65 | double Eccentricity() const
66 | {
67 | return eccentricity_;
68 | }
69 |
70 | /*
71 | * XINCL
72 | */
73 | double Inclination() const
74 | {
75 | return inclination_;
76 | }
77 |
78 | /*
79 | * XNO
80 | */
81 | double MeanMotion() const
82 | {
83 | return mean_motion_;
84 | }
85 |
86 | /*
87 | * BSTAR
88 | */
89 | double BStar() const
90 | {
91 | return bstar_;
92 | }
93 |
94 | /*
95 | * AODP
96 | */
97 | double RecoveredSemiMajorAxis() const
98 | {
99 | return recovered_semi_major_axis_;
100 | }
101 |
102 | /*
103 | * XNODP
104 | */
105 | double RecoveredMeanMotion() const
106 | {
107 | return recovered_mean_motion_;
108 | }
109 |
110 | /*
111 | * PERIGE
112 | */
113 | double Perigee() const
114 | {
115 | return perigee_;
116 | }
117 |
118 | /*
119 | * Period in minutes
120 | */
121 | double Period() const
122 | {
123 | return period_;
124 | }
125 |
126 | /*
127 | * EPOCH
128 | */
129 | DateTime Epoch() const
130 | {
131 | return epoch_;
132 | }
133 |
134 | private:
135 | double mean_anomoly_;
136 | double ascending_node_;
137 | double argument_perigee_;
138 | double eccentricity_;
139 | double inclination_;
140 | double mean_motion_;
141 | double bstar_;
142 | double recovered_semi_major_axis_;
143 | double recovered_mean_motion_;
144 | double perigee_;
145 | double period_;
146 | DateTime epoch_;
147 | };
148 |
149 | #endif
150 |
--------------------------------------------------------------------------------
/Libraries/sgp4/libsgp4/SatelliteException.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Daniel Warner
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 |
18 | #ifndef SATELLITEEXCEPTION_H_
19 | #define SATELLITEEXCEPTION_H_
20 |
21 | #include
22 |
23 | /**
24 | * @brief The exception that the SGP4 class throws upon an error.
25 | */
26 | class SatelliteException : public std::exception
27 | {
28 | public:
29 | SatelliteException(const char* message)
30 | : message_(message)
31 | {
32 | }
33 |
34 | virtual ~SatelliteException(void) throw ()
35 | {
36 | }
37 |
38 | virtual const char* what() const throw ()
39 | {
40 | return message_.c_str();
41 | }
42 |
43 | private:
44 | std::string message_;
45 | };
46 |
47 | #endif
48 |
--------------------------------------------------------------------------------
/Libraries/sgp4/libsgp4/SolarPosition.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Daniel Warner
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 |
18 | #include "SolarPosition.h"
19 |
20 | #include "Globals.h"
21 | #include "Util.h"
22 |
23 | #include
24 |
25 | Eci SolarPosition::FindPosition(const DateTime& dt)
26 | {
27 | const double mjd = dt.ToJulian() - kEPOCH_JAN1_12H_1900;
28 | const double year = 1900 + mjd / 365.25;
29 | const double T = (mjd + Delta_ET(year) / kSECONDS_PER_DAY) / 36525.0;
30 | const double M = Util::DegreesToRadians(Util::Wrap360(358.47583
31 | + Util::Wrap360(35999.04975 * T)
32 | - (0.000150 + 0.0000033 * T) * T * T));
33 | const double L = Util::DegreesToRadians(Util::Wrap360(279.69668
34 | + Util::Wrap360(36000.76892 * T)
35 | + 0.0003025 * T*T));
36 | const double e = 0.01675104 - (0.0000418 + 0.000000126 * T) * T;
37 | const double C = Util::DegreesToRadians((1.919460
38 | - (0.004789 + 0.000014 * T) * T) * sin(M)
39 | + (0.020094 - 0.000100 * T) * sin(2 * M)
40 | + 0.000293 * sin(3 * M));
41 | const double O = Util::DegreesToRadians(
42 | Util::Wrap360(259.18 - 1934.142 * T));
43 | const double Lsa = Util::WrapTwoPI(L + C
44 | - Util::DegreesToRadians(0.00569 - 0.00479 * sin(O)));
45 | const double nu = Util::WrapTwoPI(M + C);
46 | double R = 1.0000002 * (1 - e * e) / (1 + e * cos(nu));
47 | const double eps = Util::DegreesToRadians(23.452294 - (0.0130125
48 | + (0.00000164 - 0.000000503 * T) * T) * T + 0.00256 * cos(O));
49 | R = R * kAU;
50 |
51 | Vector solar_position(R * cos(Lsa),
52 | R * sin(Lsa) * cos(eps),
53 | R * sin(Lsa) * sin(eps),
54 | R);
55 |
56 | return Eci(dt, solar_position);
57 | }
58 |
59 | double SolarPosition::Delta_ET(double year) const
60 | {
61 | return 26.465 + 0.747622 * (year - 1950) + 1.886913
62 | * sin(kTWOPI * (year - 1975) / 33);
63 | }
64 |
--------------------------------------------------------------------------------
/Libraries/sgp4/libsgp4/SolarPosition.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Daniel Warner
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 |
18 | #ifndef SOLARPOSITION_H_
19 | #define SOLARPOSITION_H_
20 |
21 | #include "DateTime.h"
22 | #include "Eci.h"
23 |
24 | /**
25 | * @brief Find the position of the sun
26 | */
27 | class SolarPosition
28 | {
29 | public:
30 | SolarPosition()
31 | {
32 | }
33 |
34 | virtual ~SolarPosition()
35 | {
36 | }
37 |
38 | Eci FindPosition(const DateTime& dt);
39 |
40 | private:
41 | double Delta_ET(double year) const;
42 | };
43 |
44 | #endif
45 |
--------------------------------------------------------------------------------
/Libraries/sgp4/libsgp4/TimeSpan.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Daniel Warner
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 |
18 | #include "TimeSpan.h"
19 |
--------------------------------------------------------------------------------
/Libraries/sgp4/libsgp4/TleException.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Daniel Warner
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 |
18 | #ifndef TLEEXCEPTION_H_
19 | #define TLEEXCEPTION_H_
20 |
21 | #include
22 |
23 | /**
24 | * @brief The exception that the Tle class throws on an error.
25 | *
26 | * The exception that the Tle decoder will throw on an error.
27 | */
28 | class TleException : public std::exception
29 | {
30 | public:
31 | /**
32 | * Constructor
33 | * @param message Exception message
34 | */
35 | TleException(const char* message)
36 | : m_message(message)
37 | {
38 | }
39 |
40 | /**
41 | * Destructor
42 | */
43 | virtual ~TleException(void) throw ()
44 | {
45 | }
46 |
47 | /**
48 | * Get the exception message
49 | * @returns the exception message
50 | */
51 | virtual const char* what() const throw ()
52 | {
53 | return m_message.c_str();
54 | }
55 |
56 | private:
57 | /** the exception message */
58 | std::string m_message;
59 | };
60 |
61 | #endif
62 |
--------------------------------------------------------------------------------
/Libraries/sgp4/libsgp4/Util.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Daniel Warner
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 |
18 | #include "Util.h"
19 |
20 | #include
21 | #include
22 | #include
23 |
24 | namespace Util
25 | {
26 | namespace
27 | {
28 | struct IsDigit: std::unary_function
29 | {
30 | bool operator()(char c) const
31 | {
32 | return std::isdigit(c, std::locale::classic()) == 0;
33 | }
34 | };
35 | }
36 |
37 | void TrimLeft(std::string& s)
38 | {
39 | s.erase(s.begin(),
40 | std::find_if(s.begin(), s.end(), std::not1(IsDigit())));
41 | }
42 |
43 | void TrimRight(std::string& s)
44 | {
45 | s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(IsDigit())).base(),
46 | s.end());
47 | }
48 |
49 | void Trim(std::string& s)
50 | {
51 | TrimLeft(s);
52 | TrimRight(s);
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/Libraries/sgp4/libsgp4/Util.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Daniel Warner
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 |
18 | #ifndef UTIL_H_
19 | #define UTIL_H_
20 |
21 | #include "Globals.h"
22 |
23 | #include
24 |
25 | namespace Util
26 | {
27 | template
28 |
29 | bool FromString(const std::string& str, T& val)
30 | {
31 | std::stringstream ss(str);
32 | return !(ss >> val).fail();
33 | }
34 |
35 | /*
36 | * always positive result
37 | * Mod(-3,4)= 1 fmod(-3,4)= -3
38 | */
39 | inline double Mod(const double x, const double y)
40 | {
41 | if (y == 0)
42 | {
43 | return x;
44 | }
45 |
46 | return x - y * floor(x / y);
47 | }
48 |
49 | inline double WrapNegPosPI(const double a)
50 | {
51 | return Mod(a + kPI, kTWOPI) - kPI;
52 | }
53 |
54 | inline double WrapTwoPI(const double a)
55 | {
56 | return Mod(a, kTWOPI);
57 | }
58 |
59 | inline double WrapNegPos180(const double a)
60 | {
61 | return Mod(a + 180.0, 360.0) - 180.0;
62 | }
63 |
64 | inline double Wrap360(const double a)
65 | {
66 | return Mod(a, 360.0);
67 | }
68 |
69 | inline double DegreesToRadians(const double degrees)
70 | {
71 | return degrees * kPI / 180.0;
72 | }
73 |
74 | inline double RadiansToDegrees(const double radians)
75 | {
76 | return radians * 180.0 / kPI;
77 | }
78 |
79 | inline double AcTan(const double sinx, const double cosx)
80 | {
81 | if (cosx == 0.0)
82 | {
83 | if (sinx > 0.0)
84 | {
85 | return kPI / 2.0;
86 | }
87 | else
88 | {
89 | return 3.0 * kPI / 2.0;
90 | }
91 | }
92 | else
93 | {
94 | if (cosx > 0.0)
95 | {
96 | return atan(sinx / cosx);
97 | }
98 | else
99 | {
100 | return kPI + atan(sinx / cosx);
101 | }
102 | }
103 | }
104 |
105 | void TrimLeft(std::string& s);
106 | void TrimRight(std::string& s);
107 | void Trim(std::string& s);
108 | }
109 |
110 | #endif
111 |
--------------------------------------------------------------------------------
/Libraries/sgp4/libsgp4/Vector.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Daniel Warner
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 |
18 | #include "Vector.h"
19 |
--------------------------------------------------------------------------------
/Libraries/sgp4/libsgp4/Vector.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Daniel Warner
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 |
18 | #ifndef VECTOR_H_
19 | #define VECTOR_H_
20 |
21 | #include
22 | #include
23 | #include
24 | #include
25 |
26 | /**
27 | * @brief Generic vector
28 | *
29 | * Stores x, y, z, w
30 | */
31 | struct Vector
32 | {
33 | public:
34 |
35 | /**
36 | * Default constructor
37 | */
38 | Vector()
39 | : x(0.0), y(0.0), z(0.0), w(0.0)
40 | {
41 | }
42 |
43 | /**
44 | * Constructor
45 | * @param arg_x x value
46 | * @param arg_y y value
47 | * @param arg_z z value
48 | */
49 | Vector(const double arg_x,
50 | const double arg_y,
51 | const double arg_z)
52 | : x(arg_x), y(arg_y), z(arg_z), w(0.0)
53 | {
54 | }
55 |
56 | /**
57 | * Constructor
58 | * @param arg_x x value
59 | * @param arg_y y value
60 | * @param arg_z z value
61 | * @param arg_w w value
62 | */
63 | Vector(const double arg_x,
64 | const double arg_y,
65 | const double arg_z,
66 | const double arg_w)
67 | : x(arg_x), y(arg_y), z(arg_z), w(arg_w)
68 | {
69 | }
70 |
71 | /**
72 | * Copy constructor
73 | * @param v value to copy from
74 | */
75 | Vector(const Vector& v)
76 | {
77 | x = v.x;
78 | y = v.y;
79 | z = v.z;
80 | w = v.w;
81 | }
82 |
83 | /**
84 | * Destructor
85 | */
86 | virtual ~Vector()
87 | {
88 | }
89 |
90 | /**
91 | * Assignment operator
92 | * @param v value to copy from
93 | */
94 | Vector& operator=(const Vector& v)
95 | {
96 | if (this != &v)
97 | {
98 | x = v.x;
99 | y = v.y;
100 | z = v.z;
101 | w = v.w;
102 | }
103 | return *this;
104 | }
105 |
106 | /**
107 | * Subtract operator
108 | * @param v value to suctract from
109 | */
110 | Vector operator-(const Vector& v)
111 | {
112 | return Vector(x - v.x,
113 | y - v.y,
114 | z - v.z,
115 | 0.0);
116 | }
117 |
118 | /**
119 | * Calculates the magnitude of the vector
120 | * @returns magnitude of the vector
121 | */
122 | double Magnitude() const
123 | {
124 | return sqrt(x * x + y * y + z * z);
125 | }
126 |
127 | /**
128 | * Calculates the dot product
129 | * @returns dot product
130 | */
131 | double Dot(const Vector& vec) const
132 | {
133 | return (x * vec.x) +
134 | (y * vec.y) +
135 | (z * vec.z);
136 | }
137 |
138 | /**
139 | * Converts this vector to a string
140 | * @returns this vector as a string
141 | */
142 | std::string ToString() const
143 | {
144 | std::stringstream ss;
145 | ss << std::right << std::fixed << std::setprecision(3);
146 | ss << "X: " << std::setw(9) << x;
147 | ss << ", Y: " << std::setw(9) << y;
148 | ss << ", Z: " << std::setw(9) << z;
149 | ss << ", W: " << std::setw(9) << w;
150 | return ss.str();
151 | }
152 |
153 | /** x value */
154 | double x;
155 | /** y value */
156 | double y;
157 | /** z value */
158 | double z;
159 | /** w value */
160 | double w;
161 | };
162 |
163 | inline std::ostream& operator<<(std::ostream& strm, const Vector& v)
164 | {
165 | return strm << v.ToString();
166 | }
167 |
168 | #endif
169 |
--------------------------------------------------------------------------------
/Libraries/sgp4/passpredict/Makefile.am:
--------------------------------------------------------------------------------
1 | bin_PROGRAMS = passpredict
2 | passpredict_SOURCES = passpredict.cpp
3 | passpredict_LDADD = ../libsgp4/libsgp4.a
4 | INCLUDES = -I../libsgp4
5 |
--------------------------------------------------------------------------------
/Libraries/sgp4/runtest/Makefile.am:
--------------------------------------------------------------------------------
1 | bin_PROGRAMS = runtest
2 | runtest_SOURCES = runtest.cpp
3 | runtest_LDADD = ../libsgp4/libsgp4.a
4 | INCLUDES = -I../libsgp4
5 |
--------------------------------------------------------------------------------
/Libraries/sgp4/sattrack/Makefile.am:
--------------------------------------------------------------------------------
1 | bin_PROGRAMS = sattrack
2 | sattrack_SOURCES = sattrack.cpp
3 | sattrack_LDADD = ../libsgp4/libsgp4.a
4 | INCLUDES = -I../libsgp4
5 |
--------------------------------------------------------------------------------
/Libraries/sgp4/sattrack/sattrack.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Daniel Warner
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 |
18 | #include
19 | #include
20 | #include
21 | #include
22 |
23 | #include
24 |
25 | int main()
26 | {
27 | Observer obs(51.507406923983446, -0.12773752212524414, 0.05);
28 | Tle tle = Tle("UK-DMC 2 ",
29 | "1 35683U 09041C 12289.23158813 .00000484 00000-0 89219-4 0 5863",
30 | "2 35683 98.0221 185.3682 0001499 100.5295 259.6088 14.69819587172294");
31 | SGP4 sgp4(tle);
32 |
33 | std::cout << tle << std::endl;
34 |
35 | while (true)
36 | {
37 | /*
38 | * current time
39 | */
40 | DateTime now = DateTime::Now(true);
41 | /*
42 | * calculate satellite position
43 | */
44 | Eci eci = sgp4.FindPosition(now);
45 | /*
46 | * get look angle for observer to satellite
47 | */
48 | CoordTopocentric topo = obs.GetLookAngle(eci);
49 | /*
50 | * convert satellite position to geodetic coordinates
51 | */
52 | CoordGeodetic geo = eci.ToGeodetic();
53 |
54 | std::cout << now << " " << topo << " " << geo << std::endl;
55 | };
56 |
57 | return 0;
58 | }
59 |
--------------------------------------------------------------------------------
/Libraries/shapelib/.cvsignore:
--------------------------------------------------------------------------------
1 | dbfadd
2 | dbfcreate
3 | dbfdump
4 | shpadd
5 | shpcreate
6 | shpdump
7 | shprewind
8 | shptreedump
9 | shptest
10 | *.dll
11 | *.lib
12 | *.exp
13 | *.la
14 | *.lo
15 | .libs
16 |
--------------------------------------------------------------------------------
/Libraries/shapelib/HOWTO-RELEASE:
--------------------------------------------------------------------------------
1 | Producing Shapelib Releases
2 | ===========================
3 |
4 | 1) Update web/release.html with change notes on the new release and commit.
5 |
6 | 2) Build the release files.
7 |
8 | ./mkrelease.sh 1.3.0
9 |
10 | 3) Upload:
11 |
12 | scp shapelib-1.3.0{.tar.gz,.zip} warmerdam@upload.osgeo.org:/osgeo/download/shapelib
13 | ... add upload notes to maptools.org ...
14 |
15 | 4) Announce on shapelib mailing list.
16 |
17 |
--------------------------------------------------------------------------------
/Libraries/shapelib/Makefile:
--------------------------------------------------------------------------------
1 |
2 | PREFIX = /usr/local
3 | CFLAGS = -g -Wall -fPIC
4 | #CFLAGS = -g -DUSE_CPL
5 | #CC = g++
6 |
7 | LIBOBJ = shpopen.o dbfopen.o safileio.o shptree.o
8 | SHPBIN = shpcreate shpadd shpdump shprewind dbfcreate dbfadd dbfdump \
9 | shptreedump
10 |
11 | default: all
12 |
13 | all: $(SHPBIN) shptest lib
14 |
15 | shpopen.o: shpopen.c shapefil.h
16 | $(CC) $(CFLAGS) -c shpopen.c
17 |
18 | shptree.o: shptree.c shapefil.h
19 | $(CC) $(CFLAGS) -c shptree.c
20 |
21 | dbfopen.o: dbfopen.c shapefil.h
22 | $(CC) $(CFLAGS) -c dbfopen.c
23 |
24 | safileio.o: safileio.c shapefil.h
25 | $(CC) $(CFLAGS) -c safileio.c
26 |
27 | shpcreate: shpcreate.c shpopen.o safileio.o
28 | $(CC) $(CFLAGS) shpcreate.c shpopen.o safileio.o $(LINKOPT) -o shpcreate
29 |
30 | shpadd: shpadd.c shpopen.o safileio.o
31 | $(CC) $(CFLAGS) shpadd.c shpopen.o safileio.o $(LINKOPT) -o shpadd
32 |
33 | shpdump: shpdump.c shpopen.o safileio.o
34 | $(CC) $(CFLAGS) shpdump.c shpopen.o safileio.o $(LINKOPT) -o shpdump
35 |
36 | shprewind: shprewind.c shpopen.o safileio.o
37 | $(CC) $(CFLAGS) shprewind.c shpopen.o safileio.o $(LINKOPT) -o shprewind
38 |
39 | dbfcreate: dbfcreate.c dbfopen.o safileio.o
40 | $(CC) $(CFLAGS) dbfcreate.c dbfopen.o safileio.o $(LINKOPT) -o dbfcreate
41 |
42 | dbfadd: dbfadd.c dbfopen.o safileio.o
43 | $(CC) $(CFLAGS) dbfadd.c dbfopen.o safileio.o $(LINKOPT) -o dbfadd
44 |
45 | dbfdump: dbfdump.c dbfopen.o safileio.o
46 | $(CC) $(CFLAGS) dbfdump.c dbfopen.o safileio.o $(LINKOPT) -o dbfdump
47 |
48 | shptest: shptest.c shpopen.o safileio.o
49 | $(CC) $(CFLAGS) shptest.c shpopen.o safileio.o $(LINKOPT) -o shptest
50 |
51 | shputils: shputils.c shpopen.o safileio.o dbfopen.o
52 | $(CC) $(CFLAGS) shputils.c shpopen.o safileio.o dbfopen.o $(LINKOPT) -o shputils
53 |
54 | shptreedump: shptreedump.c shptree.o shpopen.o safileio.o
55 | $(CC) $(CFLAGS) shptreedump.c shptree.o shpopen.o safileio.o $(LINKOPT) \
56 | -o shptreedump
57 |
58 | clean:
59 | rm -f *.o shptest $(SHPBIN) libshp.a
60 |
61 | test: test2 test3
62 |
63 | #
64 | # Note this stream only works if example data is accessable.
65 | # Fetch ftp://gdal.velocet.ca/pub/outgoing/shape_eg_data.zip
66 | #
67 | test1:
68 | @./stream1.sh > s1.out
69 | @if test "`diff s1.out stream1.out`" = '' ; then \
70 | echo "******* Stream 1 Succeeded *********"; \
71 | rm s1.out; \
72 | else \
73 | echo "******* Stream 1 Failed *********"; \
74 | diff s1.out stream1.out; \
75 | fi
76 |
77 | test2:
78 | @./stream2.sh > s2.out
79 | @if test "`diff s2.out stream2.out`" = '' ; then \
80 | echo "******* Stream 2 Succeeded *********"; \
81 | rm s2.out; \
82 | rm test*.s??; \
83 | else \
84 | echo "******* Stream 2 Failed *********"; \
85 | diff s2.out stream2.out; \
86 | fi
87 |
88 | test3:
89 | @./makeshape.sh > s3.out
90 | @if test "`diff s3.out stream3.out`" = '' ; then \
91 | echo "******* Stream 3 Succeeded *********"; \
92 | rm s3.out; \
93 | rm test.*; \
94 | else \
95 | echo "******* Stream 3 Failed *********"; \
96 | diff s3.out stream3.out; \
97 | fi
98 |
99 |
100 | lib: libshp.a
101 |
102 | libshp.a: $(LIBOBJ)
103 | ar r libshp.a $(LIBOBJ)
104 |
105 | lib_install: libshp.a
106 | cp libshp.a $(PREFIX)/lib
107 | cp shapefil.h $(PREFIX)/include
108 |
109 | bin_install: $(SHPBIN)
110 | cp $(SHPBIN) $(PREFIX)/bin
111 |
112 | install: lib_install bin_install
113 |
114 |
--------------------------------------------------------------------------------
/Libraries/shapelib/README:
--------------------------------------------------------------------------------
1 |
2 | Please read shapelib.html.
3 |
4 | Building on Unix
5 | ----------------
6 |
7 | 1) Edit Makefile, and set CFLAGS, and CC macros as required for the
8 | target system. Often the defaults will work fine.
9 |
10 | 2) type "make"
11 |
12 | The result should be:
13 |
14 | Core shapelib support.
15 | shpopen.o
16 | dbfopen.o
17 | safileio.o
18 | shptree.o
19 | libshp.a
20 |
21 | Utility/demonstration programs:
22 | shpcreate, shpdump, shpadd, dbfcreate, dbfdump, dbfadd, shptreedump
23 |
24 | 3) To test type:
25 | make test
26 |
27 | 4) To libshp.a and the test binaries in /usr/local:
28 | make install
29 |
30 |
31 | Building on Windows
32 | -------------------
33 |
34 | If you have run the VC++ VCVARS32.BAT, you should be able to type the
35 | following in a command window to build the code and executables:
36 |
37 | C:> nmake /f makefile.vc
38 |
39 | Otherwise create your own VC++ project. There aren't many files to deal with
40 | here!
41 |
42 |
--------------------------------------------------------------------------------
/Libraries/shapelib/contrib/.cvsignore:
--------------------------------------------------------------------------------
1 | shpdxf
2 | dbfinfo
3 | shpcentrd
4 | shpdata
5 | shpwkb
6 | dbfcat
7 | shpinfo
8 | shpfix
9 | shpcat
10 | Shape_PointInPoly
11 | shpproj
12 | shpsort
13 |
--------------------------------------------------------------------------------
/Libraries/shapelib/contrib/Makefile:
--------------------------------------------------------------------------------
1 |
2 | #LINKOPT = /usr/local/lib/libdbmalloc.a
3 | #CFLAGS = -g
4 |
5 | # Endian: define either _LITTLE_ENDIAN or _BIG_ENDIAN
6 | ENDIAN = -D_LITTLE_ENDIAN
7 |
8 | CFLAGS = -g -I.. -I$(HOME)/bld/include -DPROJ4 $(ENDIAN) -DDEBUG -DDEBUG2
9 |
10 | SHPOBJ = ../shpopen.o ../dbfopen.o ../safileio.o
11 |
12 | SHPGOBJ = ../shpopen.o ../dbfopen.o ../safileio.o shpgeo.o
13 |
14 | GEOOBJ = ./shpgeo.o -lm -L$(HOME)/bld/lib -lproj
15 |
16 | default: all
17 |
18 | all: shpdxf shpproj dbfinfo shpcentrd shpdata shpwkb dbfinfo dbfcat shpinfo shpfix shpcat Shape_PointInPoly shpsort
19 |
20 | clean:
21 | rm -f shpdxf shpproj dbfinfo shpcentrd shpdata shpwkb dbfcat dbfinfo shpinfo shpfix shpcat *.o
22 |
23 | shpgeo.o: shpgeo.c shpgeo.h
24 | $(CC) $(CFLAGS) -c shpgeo.c
25 |
26 | shpdxf: shpdxf.c $(SHPOBJ)
27 | $(CC) $(CFLAGS) shpdxf.c ${SHPOBJ} $(LINKOPT) -o shpdxf
28 |
29 | shpcentrd: shpcentrd.c $(SHPGOBJ)
30 | $(CC) $(CFLAGS) shpcentrd.c ${SHPOBJ} $(LINKOPT) $(GEOOBJ) -o shpcentrd
31 |
32 | shpdata: shpdata.c $(SHPGOBJ)
33 | $(CC) $(CFLAGS) shpdata.c ${SHPOBJ} $(LINKOPT) $(GEOOBJ) -o shpdata
34 |
35 | shpinfo: shpinfo.c $(SHPOBJ)
36 | $(CC) $(CFLAGS) shpinfo.c ${SHPOBJ} $(LINKOPT) $(GEOOBJ) -o shpinfo
37 |
38 | shpfix: shpfix.c $(SHPOBJ)
39 | $(CC) $(CFLAGS) shpfix.c ${SHPOBJ} $(LINKOPT) -o shpfix
40 |
41 | shpcat: shpcat.c $(SHPOBJ)
42 | $(CC) $(CFLAGS) shpcat.c ${SHPOBJ} $(LINKOPT) -o shpcat
43 |
44 | shpwkb: shpwkb.c $(SHPGOBJ)
45 | $(CC) $(CFLAGS) shpwkb.c ${SHPOBJ} $(LINKOPT) $(GEOOBJ) -o shpwkb
46 |
47 | shpproj: shpproj.c $(SHPGOBJ)
48 | $(CC) $(CFLAGS) shpproj.c $(SHPOBJ) $(GEOOBJ) -lm -lproj $(LINKOPT) -o shpproj
49 |
50 | shpsort: shpsort.c $(SHPOBJ)
51 | $(CC) $(CFLAGS) shpsort.c ${SHPOBJ} $(LINKOPT) -lm -o shpsort
52 |
53 | dbfinfo: dbfinfo.c $(SHPOBJ)
54 | $(CC) $(CFLAGS) dbfinfo.c $(SHPOBJ) $(LINKOPT) -o dbfinfo
55 |
56 | dbfcat: dbfcat.c $(SHPOBJ)
57 | $(CC) $(CFLAGS) dbfcat.c $(SHPOBJ) $(LINKOPT) -o dbfcat
58 |
59 | Shape_PointInPoly: Shape_PointInPoly.cpp $(SHPOBJ)
60 | $(CXX) $(CFLAGS) Shape_PointInPoly.cpp $(SHPOBJ) $(LINKOPT) \
61 | -o Shape_PointInPoly
62 |
63 | check: testproj
64 |
65 | testproj:
66 | tests/shpproj.sh
67 |
--------------------------------------------------------------------------------
/Libraries/shapelib/contrib/Shape_PointInPoly_README.txt:
--------------------------------------------------------------------------------
1 | ===============================================================================
2 | Project: Shape_PoinInPoly
3 | Purpose: Sample and the function for calculatin a point in a polygon
4 | (complex,compound - it doesn't matter). Can be used for labeling.
5 | Author: Copyright (c) 2004, Marko Podgorsek, d-mon@siol.net
6 | ===============================================================================
7 | Requires: shapelib 1.2 (http://shapelib.maptools.org/)
8 | Tested and created on platform:
9 | Windows 2000 Professional
10 | Visual Studio .NET 7.0
11 | P4 2.4 GHz
12 | 1GB RAM
13 |
14 | I just found out about the ShapeLib, GDAL and OGR and I must say that they're
15 | all great projects.
16 | I belive I'll use some of those libraries in the future. Right now I'm using
17 | only shapelib.
18 | The thing that led me to the http://wwww.maptools.org was the need of finding
19 | the point in poly...but as I found out that even OGR didn't support it. So
20 | there I was. I was forced to make my own function. Well, it was fun. I learned
21 | a lot.
22 | I wrote this function for the Autodesk Autocad 2004 MPolygon, because there was
23 | no function to do this in the Object Arx SDK (the Acad programming SDK). Well,
24 | it will be in the 2005 release...but, still. There is a function in the
25 | Autodesk Map 2004 version...in the menu.
26 | Not usefull when you need the coordinates, not the point on the screen...
27 | So when the Acad version was done I was thinking of doing it on the Shape files,
28 | too. A little bit of changing the structures and variable
29 | types (so they're not using Object Arx) and I was done.
30 | And here it is....Contribution from me to the ShapeLib world :)...and maybe even
31 | OGR (a little bit of changing there).
32 |
33 | Some statistics:
34 | For about 69000 polygons in Autocad picture (.dwg files)
35 | Autodesk Map 2004 was creating centroids (the menu command) about 45s (1 scan
36 | line)
37 | My function, with 3 scan lines took about 5s. And I was drawing the dots on the
38 | picture...
39 |
40 | -------------------------------------------------------------------------------
41 | DPoint2d CreatePointInPoly(SHPObject *psShape, int quality)
42 |
43 | The second parameter quality tell the function just how many rays shall it use
44 | to get the point.
45 | quality = 3 works very well, but anything below 5 is good.
46 | This doesn't mean that the execution will slow down, but it just finds a good
47 | point. That's all.
48 |
49 | The qality shows on the compound objects (multiple poligons with more than one
50 | exterior loop) - if not enough rays, then there may be no centroid.
51 | Or the U shaped thin polygon, only the bootom (below the y center line) is fat.
52 | Autodesk Map with one scan line will create the centroid on one of the thin
53 | parts, because it only uses the y center line. If you have more rays, one will
54 | surely pass the fat area and centroid will be created there.
55 |
56 | -------------------------------------------------------------------------------
57 | Anyone using this function:
58 | Just send me an e-mail, so I'll see if I did anything good for the public.
59 | And you can send me e-mail with questions also.
60 |
--------------------------------------------------------------------------------
/Libraries/shapelib/contrib/dbfinfo.c:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 1999 Carl Anderson
3 | *
4 | * This code is in the public domain.
5 | *
6 | * This code is based in part on the earlier work of Frank Warmerdam
7 | *
8 | * requires shapelib 1.2
9 | * gcc dbfinfo dbfopen.o dbfinfo
10 | *
11 | *
12 | * $Log: dbfinfo.c,v $
13 | * Revision 1.3 2011-07-24 03:17:46 fwarmerdam
14 | * include string.h and stdlib.h where needed in contrib (#2146)
15 | *
16 | * Revision 1.2 1999-05-26 02:56:31 candrsn
17 | * updates to shpdxf, dbfinfo, port from Shapelib 1.1.5 of dbfcat and shpinfo
18 | *
19 | *
20 | */
21 |
22 | #include
23 | #include
24 | #include "shapefil.h"
25 |
26 | int main( int argc, char ** argv )
27 |
28 | {
29 | DBFHandle hDBF;
30 | int *panWidth, i, iRecord;
31 | char szFormat[32], szField[1024];
32 | char ftype[15], cTitle[32], nTitle[32];
33 | int nWidth, nDecimals;
34 | int cnWidth, cnDecimals;
35 | DBFHandle cDBF;
36 | DBFFieldType hType,cType;
37 | int ci, ciRecord;
38 |
39 | /* -------------------------------------------------------------------- */
40 | /* Display a usage message. */
41 | /* -------------------------------------------------------------------- */
42 | if( argc != 2 )
43 | {
44 | printf( "dbfinfo xbase_file\n" );
45 | exit( 1 );
46 | }
47 |
48 | /* -------------------------------------------------------------------- */
49 | /* Open the file. */
50 | /* -------------------------------------------------------------------- */
51 | hDBF = DBFOpen( argv[1], "rb" );
52 | if( hDBF == NULL )
53 | {
54 | printf( "DBFOpen(%s,\"r\") failed.\n", argv[1] );
55 | exit( 2 );
56 | }
57 |
58 | printf ("Info for %s\n",argv[1]);
59 |
60 | /* -------------------------------------------------------------------- */
61 | /* If there is no data in this file let the user know. */
62 | /* -------------------------------------------------------------------- */
63 | i = DBFGetFieldCount(hDBF);
64 | printf ("%ld Columns, %ld Records in file\n",i,DBFGetRecordCount(hDBF));
65 |
66 | /* -------------------------------------------------------------------- */
67 | /* Compute offsets to use when printing each of the field */
68 | /* values. We make each field as wide as the field title+1, or */
69 | /* the field value + 1. */
70 | /* -------------------------------------------------------------------- */
71 | panWidth = (int *) malloc( DBFGetFieldCount( hDBF ) * sizeof(int) );
72 |
73 | for( i = 0; i < DBFGetFieldCount(hDBF); i++ )
74 | {
75 | char szTitle[12];
76 | DBFFieldType eType;
77 |
78 | switch ( DBFGetFieldInfo( hDBF, i, szTitle, &nWidth, &nDecimals )) {
79 | case FTString:
80 | strcpy (ftype, "string");;
81 | break;
82 |
83 | case FTInteger:
84 | strcpy (ftype, "integer");
85 | break;
86 |
87 | case FTDouble:
88 | strcpy (ftype, "float");
89 | break;
90 |
91 | case FTInvalid:
92 | strcpy (ftype, "invalid/unsupported");
93 | break;
94 |
95 | default:
96 | strcpy (ftype, "unknown");
97 | break;
98 | }
99 | printf ("%15.15s\t%15s (%d,%d)\n",szTitle, ftype, nWidth, nDecimals);
100 |
101 | }
102 |
103 | DBFClose( hDBF );
104 |
105 | return( 0 );
106 | }
107 |
--------------------------------------------------------------------------------
/Libraries/shapelib/contrib/doc/shpproj.txt:
--------------------------------------------------------------------------------
1 |
2 |
3 | shpproj
4 |
5 |
6 |
7 | using the projection tools proj and invproj
8 | we have implemented a shapefile projection utility
9 |
10 | shpproj shp_file new_shp ( -i=in_proj_file | -i="in_params" | -i=geographic ) ( -o=out_info_file | -o="out_params" | -o=geographic )
11 |
12 | INPUT
13 | Input can come from one of three sources. A projection parameter file,
14 | directly through parameters or geographic. If the shapefile has an associated
15 | prj file, name the same as the shapefile but ending in ".prj" it will be used
16 | by default ignoring all other parameters. If input is omitted it defaults to
17 | geographic, unless the default prj file exists..
18 |
19 | OUTPUT
20 | Output can come from one of three sources. A projection parameter file,
21 | directly through parameters or geographic. If output is omitted it defaults
22 | to geographic.
23 |
24 | PROJECTION PARAMETER FILE
25 | This file MUST end with the extension ".prj". It has the form of one
26 | projection parameter per line. Parameters can be in any order.
27 |
28 | PROJECTION PARAMETERS
29 | Are the same as used by proj and invproj.
30 | use proj -lP to see available projections
31 | proj -lu to see available units
32 | proj -le to see available ellipsoid
33 |
34 |
35 | USAGE
36 |
37 | the following example projects file rowtest to row3, moving data from Stateplane NAD83 zone 1002 to utm zone 16 in meters
38 |
39 | shpproj rowtest row -i="init=nad83:1002 units=us-ft" -o="proj=utm zone=16 units=m"
40 |
41 | shpproj rowtest row3 -o="proj=utm zone=18 units=m" -i="zone=16 proj=utm units=us-ft"
42 |
43 | shpproj rowtest row3 -o="proj=utm zone=18 units=m"
44 |
45 | shpproj rowtest row3 -i=myfile.prj -o=geographic
46 | shpproj rowtest row3 -is=myfile.prj
47 |
48 |
49 | Datums
50 | Stateplane data can be accessed by the init function
51 | init=nad83:1003
52 | which is of the form
53 | datum:FIPSzone
54 |
55 | To move from NAD27 to NAD83 or otherwise the shpproj utility moves to
56 | geographic coordinates and the back to the desired datum. proj can handle
57 | direct datum to datum conversions but it is umimplemented here.
58 |
59 | for a complete listing of FIPSZones by datum read nad/nad.lst in the PROJ4
60 | library
61 |
62 |
63 | CAUTION
64 |
65 | It is possible to get very poor results for projection values when using
66 | coordinates VERY far away from the intended scope of the projection.
67 |
68 | An example of a poor projection choice would be to move from nad83:1002
69 | (Georgia West) for data in California into utm. The resulting data will be
70 | much less accurate than if it had started as geographic.
71 |
72 |
--------------------------------------------------------------------------------
/Libraries/shapelib/contrib/makefile.vc:
--------------------------------------------------------------------------------
1 |
2 | CFLAGS = /Ox /MD /nologo /I.. /IC:\OSGeo4W\include \
3 | /D_LITTLE_ENDIAN -DPROJ4
4 |
5 | LINKARGS = ..\shapelib_i.lib C:\OSGeo4W\lib\proj_i.lib
6 |
7 | default: all
8 |
9 | all: shpcat.exe shpcentrd.exe shpdxf.exe shpinfo.exe shpproj.exe
10 |
11 | shpcat.exe: shpcat.obj shpgeo.obj
12 | $(CC) $(CFLAGS) shpcat.obj $(LINKARGS)
13 | if exist $@.manifest mt -manifest $@.manifest -outputresource:$@;1
14 |
15 | shpcentrd.exe: shpcentrd.obj shpgeo.obj
16 | $(CC) $(CFLAGS) shpcentrd.obj shpgeo.obj $(LINKARGS)
17 | if exist $@.manifest mt -manifest $@.manifest -outputresource:$@;1
18 |
19 | shpproj.exe: shpproj.obj shpgeo.obj
20 | $(CC) $(CFLAGS) shpproj.obj shpgeo.obj $(LINKARGS)
21 | if exist $@.manifest mt -manifest $@.manifest -outputresource:$@;1
22 |
23 | shpdxf.exe: shpdxf.obj shpgeo.obj
24 | $(CC) $(CFLAGS) shpdxf.obj $(LINKARGS)
25 | if exist $@.manifest mt -manifest $@.manifest -outputresource:$@;1
26 |
27 | shpinfo.exe: shpinfo.obj shpgeo.obj
28 | $(CC) $(CFLAGS) shpinfo.obj $(LINKARGS)
29 | if exist $@.manifest mt -manifest $@.manifest -outputresource:$@;1
30 |
31 | clean:
32 | -del *.obj
33 | -del *.exe
34 | -del *.manifest
35 |
--------------------------------------------------------------------------------
/Libraries/shapelib/contrib/my_nan.h:
--------------------------------------------------------------------------------
1 | /* `NAN' constant for IEEE 754 machines.
2 | Copyright (C) 1992, 1996 Free Software Foundation, Inc.
3 | This file is part of the GNU C Library.
4 |
5 | The GNU C Library is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU Library General Public License as
7 | published by the Free Software Foundation; either version 2 of the
8 | License, or (at your option) any later version.
9 |
10 | The GNU C Library is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | Library General Public License for more details.
14 |
15 | You should have received a copy of the GNU Library General Public
16 | License along with the GNU C Library; see the file COPYING.LIB. If not,
17 | write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 | Boston, MA 02111-1307, USA. */
19 |
20 | #ifndef _GNU_NAN_H
21 |
22 | #define _GNU_NAN_H 1
23 |
24 |
25 | /* hacked to define NAN on Solaris 2.7 if it wasn't defined */
26 |
27 | /* IEEE Not A Number. */
28 |
29 | #ifdef _BIG_ENDIAN
30 | # define __nan_bytes { 0x7f, 0xf8, 0, 0, 0, 0, 0, 0 }
31 | #endif
32 | #ifdef _LITTLE_ENDIAN
33 | # define __nan_bytes { 0, 0, 0, 0, 0, 0, 0xf8, 0x7f }
34 | #endif
35 |
36 | #ifdef __GNUC__
37 | # define NAN \
38 | (__extension__ ((union { unsigned char __c[8]; \
39 | double __d; }) \
40 | { __nan_bytes }).__d)
41 | #else /* Not GCC. */
42 | static const char __nan[8] = __nan_bytes;
43 | # define NAN (*(const double *) __nan)
44 | #endif
45 |
46 | #endif /* gnu_nan.h */
47 |
--------------------------------------------------------------------------------
/Libraries/shapelib/contrib/shpcat.c:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * Copyright (c) 1999, Carl Anderson
3 | *
4 | * This code is based in part on the earlier work of Frank Warmerdam
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a
7 | * copy of this software and associated documentation files (the "Software"),
8 | * to deal in the Software without restriction, including without limitation
9 | * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 | * and/or sell copies of the Software, and to permit persons to whom the
11 | * Software is furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included
14 | * in all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 | * DEALINGS IN THE SOFTWARE.
23 | ******************************************************************************
24 | *
25 | * shpcat
26 | *
27 | * gcc shpcat.c ../shpopen.o -o shpcat
28 | *
29 | * Utility program to concatenate two shapefiles
30 | * Must be used in concert with dbfcat
31 | *
32 | */
33 |
34 | #include
35 | #include
36 | #include "shapefil.h"
37 |
38 | int dbfcat_main( int argc, char ** argv );
39 |
40 | int main( int argc, char ** argv )
41 |
42 | {
43 | SHPHandle hSHP, cSHP;
44 | int nShapeType, i, nEntities, nShpInFile;
45 | SHPObject *shape;
46 |
47 | /* -------------------------------------------------------------------- */
48 | /* Display a usage message. */
49 | /* -------------------------------------------------------------------- */
50 | if( argc != 3 )
51 | {
52 | printf( "shpcat from_shpfile to_shpfile\n" );
53 | exit( 1 );
54 | }
55 |
56 | /* -------------------------------------------------------------------- */
57 | /* Open the passed shapefile. */
58 | /* -------------------------------------------------------------------- */
59 | hSHP = SHPOpen( argv[1], "rb" );
60 |
61 | if( hSHP == NULL )
62 | {
63 | printf( "Unable to open:%s\n", argv[1] );
64 | exit( 1 );
65 | }
66 |
67 | SHPGetInfo( hSHP, &nEntities, &nShapeType, NULL, NULL );
68 | fprintf(stderr,"Opened From File %s, with %d shapes\n",argv[1],nEntities);
69 |
70 | /* -------------------------------------------------------------------- */
71 | /* Open the passed shapefile. */
72 | /* -------------------------------------------------------------------- */
73 | cSHP = SHPOpen( argv[2], "rb+" );
74 |
75 | if( cSHP == NULL )
76 | {
77 | printf( "Unable to open:%s\n", argv[2] );
78 | exit( 1 );
79 | }
80 |
81 | SHPGetInfo( cSHP, &nShpInFile, NULL, NULL, NULL );
82 | fprintf(stderr,"Opened to file %s with %d shapes, ready to add %d\n",
83 | argv[2],nShpInFile,nEntities);
84 |
85 | /* -------------------------------------------------------------------- */
86 | /* Skim over the list of shapes, printing all the vertices. */
87 | /* -------------------------------------------------------------------- */
88 | for( i = 0; i < nEntities; i++ )
89 | {
90 | shape = SHPReadObject( hSHP, i );
91 | SHPWriteObject( cSHP, -1, shape );
92 | SHPDestroyObject ( shape );
93 |
94 | }
95 |
96 | SHPClose( hSHP );
97 | SHPClose( cSHP );
98 |
99 | exit( 0 );
100 | }
101 |
--------------------------------------------------------------------------------
/Libraries/shapelib/contrib/shpfix.c:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * Copyright (c) 1999, Carl Anderson
3 | *
4 | * This code is based in part on the earlier work of Frank Warmerdam
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a
7 | * copy of this software and associated documentation files (the "Software"),
8 | * to deal in the Software without restriction, including without limitation
9 | * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 | * and/or sell copies of the Software, and to permit persons to whom the
11 | * Software is furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included
14 | * in all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 | * DEALINGS IN THE SOFTWARE.
23 | ******************************************************************************
24 | * shpfix
25 | *
26 | *
27 | * gcc -c shpfix.c shpopen.c -o shpfix
28 | *
29 | * Utility program to fix nulls and inconsistencies in Shapefiles
30 | * as happens from time to time
31 | *
32 | * Simply load and rewrite each record, parameter fixrex allow user to null
33 | * a particularly nasty record if needed
34 | *
35 | */
36 |
37 | #include
38 | #include
39 | #include "shapefil.h"
40 |
41 | int main( int argc, char ** argv )
42 |
43 | {
44 | SHPHandle hSHP, cSHP;
45 | int nShapeType, cShapeType, nEntities, i;
46 | double adBounds[4];
47 | SHPObject *shape;
48 | int fix_rec;
49 |
50 | /* -------------------------------------------------------------------- */
51 | /* Display a usage message. */
52 | /* -------------------------------------------------------------------- */
53 | if( argc <= 3 )
54 | {
55 | printf( "shpfix shpfile new_file \n" );
56 | exit( 1 );
57 | }
58 |
59 | fix_rec = atoi (argv[3]);
60 | fix_rec --;
61 |
62 | /* -------------------------------------------------------------------- */
63 | /* Open the passed shapefile. */
64 | /* -------------------------------------------------------------------- */
65 | hSHP = SHPOpen( argv[1], "rb+" );
66 |
67 | if( hSHP == NULL )
68 | {
69 | printf( "Unable to open:%s\n", argv[1] );
70 | exit( 1 );
71 | }
72 |
73 | SHPGetInfo( hSHP, &nEntities, &nShapeType, NULL, NULL );
74 |
75 |
76 | /* -------------------------------------------------------------------- */
77 | /* Open the passed shapefile. */
78 | /* -------------------------------------------------------------------- */
79 | cSHP = SHPCreate( argv[2], nShapeType );
80 |
81 | if( cSHP == NULL )
82 | {
83 | printf( "Unable to open:%s\n", argv[2] );
84 | exit( 1 );
85 | }
86 |
87 | SHPGetInfo( cSHP, NULL, &cShapeType, &(adBounds[0]), &(adBounds[2]) );
88 |
89 |
90 | /* -------------------------------------------------------------------- */
91 | /* Skim over the list of shapes, printing all the vertices. */
92 | /* -------------------------------------------------------------------- */
93 |
94 | for( i = 0; i < nEntities; i++ )
95 | {
96 |
97 | shape = SHPReadObject( hSHP, i );
98 | if ( i == fix_rec )
99 | { shape->nParts = 0;
100 | shape->nVertices = 0;
101 | }
102 | SHPWriteObject( cSHP, -1, shape );
103 | SHPDestroyObject ( shape );
104 |
105 | }
106 |
107 |
108 | SHPClose ( hSHP );
109 | SHPClose ( cSHP );
110 | }
111 |
--------------------------------------------------------------------------------
/Libraries/shapelib/contrib/shpsort.txt:
--------------------------------------------------------------------------------
1 | ============================= ABOUT ===========================================
2 |
3 | The program "shpsort" is a standalone program for sorting shapefiles
4 | on one or more fields (including the pseudofield "SHAPE") and outputing
5 | the results. People may find it useful for forcing drawing order.
6 |
7 | ============================= AUTHOR ==========================================
8 |
9 | Eric G. Miller
10 | California Department of Fish and Game
11 | 2004-06-30
12 |
13 | ============================= USAGE ===========================================
14 |
15 | shpsort {SORT_ORDER;SORT_ORDER...}
16 |
17 | ============================= DETAILS =========================================
18 |
19 | INFILE The input shapefile
20 |
21 | OUTFILE The output shapefile
22 |
23 | SORT_FIELD Any attribute field of the shapefile, including "SHAPE"
24 |
25 | SORT_ORDER Specify "ASCENDING" or "DESCENDING" for each SORT_FIELD.
26 | This field is optional, and is assumed to be ASCENDING
27 | unless the exact word "DESCENDING" is specified (case
28 | matters).
29 |
30 | When sorting on the "SHAPE" the records are sorted as follows:
31 |
32 | * Null shapes are treated as any other null field and will
33 | sort to the top in ASCENDING mode. A warning is issued
34 | for each null shape encountered.
35 | * POINT, POINTM, POINTZ, MULTIPOINT, MULTIPOINTM, MULTIPOINTZ
36 | and MULTIPATCH are all sorted by the maximum "Y" value of
37 | their envelopes (not particularly useful).
38 | * POLYLINE, POLYLINEZ and POLYLINEM are sorted by total 2d
39 | shape length.
40 | * POLYGON, POLYGONZ and POLYGONM are sorted by the 2d shape
41 | area. Shapes are assumed to be in canonical ordering, so that
42 | the area of interior rings (if any) is subtracted from the
43 | area of exterior rings.
44 |
45 |
--------------------------------------------------------------------------------
/Libraries/shapelib/contrib/tests/shpproj.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | cd tests
4 |
5 | rm test*
6 | shpcreate test point
7 |
8 | shpadd test -83.54949956 34.992401
9 | shpadd test -83.52162155 34.99276748
10 | shpadd test -84.01681518 34.67275985
11 | shpadd test -84.15596023 34.64862437
12 | shpadd test -83.61951463 34.54927047
13 |
14 | dbfcreate test -s fd 30
15 | dbfadd test "1"
16 | dbfadd test "2"
17 | dbfadd test "3"
18 | dbfadd test "4"
19 | dbfadd test "5"
20 |
21 | ../shpproj test test_1 -i=geographic -o="init=nad83:1002 units=us-ft"
22 | ../shpproj test_1 test_2 -o="proj=utm zone=16 units=m"
23 | ../shpproj test_2 test_3 -o=geographic
24 |
25 | shpdump test > test.out
26 | shpdump test_3 > test_3.out
27 | result=`diff test.out test_3.out`
28 |
29 | if [ -z "${result}" ]; then
30 | echo success...
31 | else
32 | echo failure...
33 | fi
34 |
35 | rm test*
36 |
37 |
38 | cd ..
39 |
--------------------------------------------------------------------------------
/Libraries/shapelib/makefile.vc:
--------------------------------------------------------------------------------
1 |
2 | #CFLAGS = /DSHPAPI_CALL=__stdcall
3 | CFLAGS = /nologo /Ox /MD /DSHAPELIB_DLLEXPORT
4 |
5 | IMPORT_LIB = shapelib_i.lib
6 | STATIC_LIB = shapelib.lib
7 | DLLNAME = shapelib.dll
8 | LINK_LIB = $(IMPORT_LIB)
9 |
10 | OBJ = shpopen.obj dbfopen.obj shptree.obj safileio.obj
11 |
12 | all: $(STATIC_LIB) $(DLLNAME) \
13 | shpcreate.exe shpadd.exe shpdump.exe shprewind.exe dbfcreate.exe \
14 | dbfadd.exe dbfdump.exe shptest.exe shptreedump.exe
15 |
16 | shpopen.obj: shpopen.c shapefil.h
17 | $(CC) $(CFLAGS) -c shpopen.c
18 |
19 | shptree.obj: shptree.c shapefil.h
20 | $(CC) $(CFLAGS) -c shptree.c
21 |
22 | dbfopen.obj: dbfopen.c shapefil.h
23 | $(CC) $(CFLAGS) -c dbfopen.c
24 |
25 | safileio.obj: safileio.c shapefil.h
26 | $(CC) $(CFLAGS) -c safileio.c
27 |
28 | shpcreate.exe: shpcreate.c $(LINK_LIB)
29 | $(CC) $(CFLAGS) shpcreate.c $(LINK_LIB) $(LINKOPT)
30 | if exist $@.manifest mt -manifest $@.manifest -outputresource:$@;1
31 |
32 | shpadd.exe: shpadd.c $(LINK_LIB)
33 | $(CC) $(CFLAGS) shpadd.c $(LINK_LIB) $(LINKOPT)
34 | if exist $@.manifest mt -manifest $@.manifest -outputresource:$@;1
35 |
36 | shpdump.exe: shpdump.c $(LINK_LIB)
37 | $(CC) $(CFLAGS) shpdump.c $(LINK_LIB) $(LINKOPT)
38 | if exist $@.manifest mt -manifest $@.manifest -outputresource:$@;1
39 |
40 | shprewind.exe: shprewind.c $(LINK_LIB)
41 | $(CC) $(CFLAGS) shprewind.c $(LINK_LIB) $(LINKOPT)
42 | if exist $@.manifest mt -manifest $@.manifest -outputresource:$@;1
43 |
44 | dbfcreate.exe: dbfcreate.c $(LINK_LIB)
45 | $(CC) $(CFLAGS) dbfcreate.c $(LINK_LIB) $(LINKOPT)
46 | if exist $@.manifest mt -manifest $@.manifest -outputresource:$@;1
47 |
48 | dbfadd.exe: dbfadd.c $(LINK_LIB)
49 | $(CC) $(CFLAGS) dbfadd.c $(LINK_LIB) $(LINKOPT)
50 | if exist $@.manifest mt -manifest $@.manifest -outputresource:$@;1
51 |
52 | dbfdump.exe: dbfdump.c $(LINK_LIB)
53 | $(CC) $(CFLAGS) dbfdump.c $(LINK_LIB) $(LINKOPT)
54 | if exist $@.manifest mt -manifest $@.manifest -outputresource:$@;1
55 |
56 | shptest.exe: shptest.c $(LINK_LIB)
57 | $(CC) $(CFLAGS) shptest.c $(LINK_LIB) $(LINKOPT)
58 | if exist $@.manifest mt -manifest $@.manifest -outputresource:$@;1
59 |
60 | shputils.exe: shputils.c $(LINK_LIB)
61 | $(CC) $(CFLAGS) shputils.c $(LINK_LIB) $(LINKOPT)
62 | if exist $@.manifest mt -manifest $@.manifest -outputresource:$@;1
63 |
64 | shptreedump.exe: shptreedump.c $(LINK_LIB)
65 | $(CC) $(CFLAGS) shptreedump.c $(LINK_LIB) $(LINKOPT)
66 | if exist $@.manifest mt -manifest $@.manifest -outputresource:$@;1
67 |
68 | shpdiff.exe: shpdiff.c $(LINK_LIB)
69 | $(CC) $(CFLAGS) shpdiff.c $(LINK_LIB) $(LINKOPT)
70 | if exist $@.manifest mt -manifest $@.manifest -outputresource:$@;1
71 |
72 | clean:
73 | -del *.obj
74 | -del *.exe
75 | -del *.lib
76 | -del *.dll
77 | -del *.manifest
78 |
79 | $(STATIC_LIB): $(OBJ)
80 | lib /nologo /out:$(STATIC_LIB) $(OBJ)
81 |
82 | $(IMPORT_LIB): $(DLLNAME)
83 |
84 | $(DLLNAME): $(OBJ)
85 | link /nologo /dll /out:$(DLLNAME) /implib:$(IMPORT_LIB) $(OBJ)
86 | if exist $(DLLNAME).manifest mt /nologo -manifest $(DLLNAME).manifest -outputresource:$(DLLNAME);2
87 |
--------------------------------------------------------------------------------
/Libraries/shapelib/makeshape.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | #
4 | # Use example programs to create a very simple dataset that
5 | # should display in ARCView II.
6 | #
7 |
8 | ./shpcreate test polygon
9 | ./dbfcreate test.dbf -s Description 30 -n TestInt 6 0 -n TestDouble 16 5
10 |
11 | ./shpadd test 0 0 100 0 100 100 0 100 0 0 + 20 20 20 30 30 30 20 20
12 | ./dbfadd test.dbf "Square with triangle missing" 1.5 2.5
13 |
14 | ./shpadd test 150 150 160 150 180 170 150 150
15 | ./dbfadd test.dbf "Smaller triangle" 100 1000.25
16 |
17 | ./shpadd test 150 150 160 150 180 170 150 150
18 | ./dbfadd test.dbf "" "" ""
19 |
20 | ./shpdump test.shp
21 | ./dbfdump test.dbf
22 |
--------------------------------------------------------------------------------
/Libraries/shapelib/mkdist.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | if [ $# -lt 1 ] ; then
4 | echo "Usage: mkdist.sh "
5 | echo " - version number used in name of generated archive."
6 | echo "Example: mkdist.sh 1.1.4"
7 | exit
8 | fi
9 |
10 | VERSION=$1
11 |
12 | rm -rf dist_wrk
13 | mkdir dist_wrk
14 | cd dist_wrk
15 |
16 | REP=:pserver:cvsanon@cvs.maptools.org:/cvs/maptools/cvsroot
17 | if cvs -d $REP co shapelib ; then
18 | echo checkout succeeds.
19 | else
20 | cvs -d $REP login
21 | cvs -d $REP co shapelib
22 | fi
23 |
24 | if [ ! -d shapelib ] ; then
25 | exit 1
26 | fi
27 |
28 | mv shapelib shapelib-$VERSION
29 |
30 | find . -name CVS -type d -exec echo rm -rf {} \;
31 |
32 | tar czvf ../shapelib-$VERSION.tar.gz shapelib-$VERSION
33 | zip -r ../shapelib-$VERSION.zip shapelib-$VERSION
34 | cd ..
35 | rm -rf dist_wrk
36 |
37 |
38 |
--------------------------------------------------------------------------------
/Libraries/shapelib/mkinstalldirs:
--------------------------------------------------------------------------------
1 | #! /bin/sh
2 | # mkinstalldirs --- make directory hierarchy
3 | # Author: Noah Friedman
4 | # Created: 1993-05-16
5 | # Public domain
6 |
7 | errstatus=0
8 |
9 | for file
10 | do
11 | set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
12 | shift
13 |
14 | pathcomp=
15 | for d
16 | do
17 | pathcomp="$pathcomp$d"
18 | case "$pathcomp" in
19 | -* ) pathcomp=./$pathcomp ;;
20 | esac
21 |
22 | if test ! -d "$pathcomp"; then
23 | echo "mkdir $pathcomp"
24 |
25 | mkdir "$pathcomp" || lasterr=$?
26 |
27 | if test ! -d "$pathcomp"; then
28 | errstatus=$lasterr
29 | fi
30 | fi
31 |
32 | pathcomp="$pathcomp/"
33 | done
34 | done
35 |
36 | exit $errstatus
37 |
38 | # mkinstalldirs ends here
39 |
--------------------------------------------------------------------------------
/Libraries/shapelib/mkrelease.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | #
3 | # mkrelease.sh - prepares Shapelib source distribution package
4 | #
5 | if [ $# -lt 1 ] ; then
6 | echo "Usage: mkrelease.sh "
7 | echo " - version number used in name of generated archive."
8 | echo
9 | echo "Example: mkrelease 1.3.0beta1"
10 | exit
11 | fi
12 |
13 | #
14 | # Processing script input arguments
15 | #
16 | VERSION=$1
17 |
18 | #
19 | # Checkout Shapelib sources from the repository
20 | #
21 | echo "* Downloading Shapelib sources from CVS..."
22 | rm -rf dist_wrk
23 | mkdir dist_wrk
24 | cd dist_wrk
25 |
26 | cvs -d :pserver:cvsanon@cvs.maptools.org:/cvs/maptools/cvsroot export -D now shapelib
27 |
28 | if [ \! -d shapelib ] ; then
29 | echo "checkout reported an error ..."
30 | echo "perhaps you need to do:"
31 | echo "cvs -d :pserver:cvsanon@cvs.maptools.org:/cvs/maptools/cvsroot login"
32 | cd ..
33 | rm -rf dist_wrk
34 | exit
35 | fi
36 |
37 | #
38 | # Make distribution packages
39 | #
40 | echo "* Making distribution packages..."
41 |
42 | mv shapelib shapelib-${VERSION}
43 |
44 | rm -f ../shapelib-${VERSION}.tar.gz ../shapelib-${VERSION}.zip
45 |
46 | tar cf ../shapelib-${VERSION}.tar shapelib-${VERSION}
47 | gzip -9 ../shapelib-${VERSION}.tar
48 | zip -r ../shapelib-${VERSION}.zip shapelib-${VERSION}
49 |
50 | echo "* Cleaning..."
51 | cd ..
52 | rm -rf dist_wrk
53 |
54 | echo "*** The End ***"
55 |
56 |
--------------------------------------------------------------------------------
/Libraries/shapelib/shapelib.def:
--------------------------------------------------------------------------------
1 | LIBRARY shapelib
2 | EXPORTS SHPOpen
3 | SHPCreate
4 | SHPGetInfo
5 | SHPReadObject
6 | SHPWriteObject
7 | SHPDestroyObject
8 | SHPComputeExtents
9 | SHPCreateObject
10 | SHPCreateSimpleObject
11 | SHPClose
12 | SHPWriteHeader
13 | SHPTypeName
14 | SHPPartTypeName
15 | SHPCreateTree
16 | SHPDestroyTree
17 | SHPTreeAddShapeId
18 | SHPTreeTrimExtraNodes
19 | SHPTreeFindLikelyShapes
20 | SHPCheckBoundsOverlap
21 | DBFOpen
22 | DBFCreate
23 | DBFGetFieldCount
24 | DBFGetRecordCount
25 | DBFAddField
26 | DBFGetFieldInfo
27 | DBFReadIntegerAttribute
28 | DBFReadDoubleAttribute
29 | DBFReadStringAttribute
30 | DBFWriteIntegerAttribute
31 | DBFWriteDoubleAttribute
32 | DBFWriteStringAttribute
33 | DBFReadTuple
34 | DBFWriteTuple
35 | DBFCloneEmpty
36 | DBFClose
37 | DBFWriteNULLAttribute
38 | DBFGetFieldIndex
39 | DBFIsAttributeNULL
40 | DBFWriteLogicalAttribute
41 | DBFReadLogicalAttribute
42 | DBFUpdateHeader
43 | DBFGetNativeFieldType
44 | SHPRewindObject
45 | DBFIsRecordDeleted
46 | DBFMarkRecordDeleted
47 |
--------------------------------------------------------------------------------
/Libraries/shapelib/stream1.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | EG_DATA=/u/www/projects/shapelib/eg_data
4 |
5 | echo -------------------------------------------------------------------------
6 | echo Test 1: dump anno.shp
7 | echo -------------------------------------------------------------------------
8 | ./shpdump $EG_DATA/anno.shp | head -250
9 |
10 | echo -------------------------------------------------------------------------
11 | echo Test 2: dump brklinz.shp
12 | echo -------------------------------------------------------------------------
13 | ./shpdump $EG_DATA/brklinz.shp | head -500
14 |
15 | echo -------------------------------------------------------------------------
16 | echo Test 3: dump polygon.shp
17 | echo -------------------------------------------------------------------------
18 | ./shpdump $EG_DATA/polygon.shp | head -500
19 |
20 | echo -------------------------------------------------------------------------
21 | echo Test 4: dump pline.dbf - uses new F field type
22 | echo -------------------------------------------------------------------------
23 | ./dbfdump -m -h $EG_DATA/pline.dbf | head -50
24 |
25 | echo -------------------------------------------------------------------------
26 | echo Test 5: NULL Shapes.
27 | echo -------------------------------------------------------------------------
28 | ./shpdump $EG_DATA/csah.dbf | head -150
29 |
--------------------------------------------------------------------------------
/Libraries/shapelib/stream2.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13; do
4 | echo -----------------------------------------------------------------------
5 | echo Test 2/$i
6 | echo -----------------------------------------------------------------------
7 |
8 | ./shptest $i
9 | ./shpdump test${i}.shp
10 | done
11 |
12 |
--------------------------------------------------------------------------------
/Libraries/shapelib/stream3.out:
--------------------------------------------------------------------------------
1 | Shapefile Type: Polygon # of Shapes: 3
2 |
3 | File Bounds: (0,0,0,0)
4 | to (180,170,0,0)
5 |
6 | Shape:0 (Polygon) nVertices=9, nParts=2
7 | Bounds:(0,0, 0)
8 | to (100,100, 0)
9 | (0,0, 0) Ring
10 | (100,0, 0)
11 | (100,100, 0)
12 | (0,100, 0)
13 | (0,0, 0)
14 | + (20,20, 0) Ring
15 | (20,30, 0)
16 | (30,30, 0)
17 | (20,20, 0)
18 |
19 | Shape:1 (Polygon) nVertices=4, nParts=1
20 | Bounds:(150,150, 0)
21 | to (180,170, 0)
22 | (150,150, 0) Ring
23 | (160,150, 0)
24 | (180,170, 0)
25 | (150,150, 0)
26 |
27 | Shape:2 (Polygon) nVertices=4, nParts=1
28 | Bounds:(150,150, 0)
29 | to (180,170, 0)
30 | (150,150, 0) Ring
31 | (160,150, 0)
32 | (180,170, 0)
33 | (150,150, 0)
34 | Descriptio TestInt TestDouble
35 | Square with triangle missing 1 2.50000
36 | Smaller triangle 100 1000.25000
37 | (NULL) (NULL) (NULL)
38 |
--------------------------------------------------------------------------------
/Libraries/shapelib/web/.cvsignore:
--------------------------------------------------------------------------------
1 | robots.txt
2 | dl
3 |
--------------------------------------------------------------------------------
/Libraries/shapelib/web/codepage.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Libraries/shapelib/web/codepage.html
--------------------------------------------------------------------------------
/Libraries/shapelib/web/index.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anoved/Ground-Track-Generator/fce7be46552bbfa62abf6c9b9ae7dcb8287ea1ab/Libraries/shapelib/web/index.html
--------------------------------------------------------------------------------
/Libraries/shapelib/web/license.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Shapelib License
4 |
5 |
6 |
7 |
8 |
License
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.
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.
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.
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:
41 |
42 | The above copyright notice and this permission notice shall be included
43 | in all copies or substantial portions of the Software.
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.
52 |
53 |
54 |
Shapelib Modifications
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.
64 |
65 |
Opting for LGPL
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.
web/index.html: This file - general documentation on the
12 | Shapefile C Library.
13 |
14 |
web/shp_api.html: Documentation
15 | for the API for accessing the .shp/.shx files.
16 |
17 |
web/dbf_api.html: Documentation
18 | for the API for accessing the .dbf attribute files.
19 |
20 |
shpopen.c: C code for access to .shp/.shx vertex files.
21 |
22 |
dbfopen.c: C code for access to .dbf attribute file.
23 |
24 |
shapefil.h: Include file defining all the services of dbfopen.c
25 | and shpopen.c.
26 |
27 |
contrib/: A directory of "in progress" contributed programs
28 | from Carl Anderson.
29 |
30 |
dbfcreate.c: Simple example program for creating a new .dbf file.
31 |
32 |
33 |
dbfadd.c:
34 | Simple example program for adding a record to a .dbf file.
35 |
36 |
dbfdump.c: Simple example program for displaying the contents of
37 | a .dbf file.
38 |
39 |
shpcreate.c: Simple example program for creating a new .shp and
40 | .shx file.
41 |
42 |
shpadd.c: Simple example program for adding a shape to an existing
43 | shape file.
44 |
45 |
shpdump.c: Simple program for dumping all the vertices in a
46 | shapefile with an indicating of the parts.
47 |
48 |
shputils.c: 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.
52 |
53 |
Makefile: A simple makefile to compile the library and example
54 | programs.
55 |
56 |
makeshape.sh: A simple script for running some of the example
57 | programs.
58 |
59 |
shptest.c: A simple test harnass to generate each of the supported
60 | types of shapefiles.
61 |
62 |
63 |
shptree.c: Implements a simple quadtree algorithm for fast
64 | spatial searches of shapefiles.
65 |
66 |
shptreedump.c: A simple mainly showing information on quad
67 | trees build using the quad tree api.
68 |
69 |
stream1.sh - A test script, which should produce stream1.out.
70 | Note this will only work if you have the example data downloaded.
71 |
72 |
stream1.out: Expected output of stream1.sh test script.
73 |
74 |
stream2.sh: A test script, which should produce stream2.out.
75 |
76 |
stream2.out: Expected output of stream2.sh test script.
9 |
10 | To get notification of new releases of Shapelib subscribe 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.
14 |
15 | Release 1.3.0:
16 |
17 |
Major rework to us application provided hooks for file io, and error reporting (SAHooks).
18 |
Added contrib/Shape_PointInPoly.cpp from Marko Podgorsek.
19 |
Added shapelib tools documentation from Eduardo Patto Kanegae.
20 |
Added dbf deletion support.
21 |
Added DBFAddNativeFieldType().
22 |
Added DBFDeleteField(), DBFReorderFields() and DBFAlterFields() to
23 | rework DBF schema.
24 |
likely a variety of other changes - it has been eight years since 1.2.10!
25 |
26 |
27 | Release 1.2.10: Added SHPRewindObject() function, and shprewind utility
28 | program. Added FTLogical, DBFReadLogicalAttribute() and
29 | DBFWriteLogicalAttribute() (thanks to Olek Neyman).
30 |
31 | Release 1.2.9: 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).
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 |
39 |
40 | Release 1.2.8: Added hacked libtool support (supplied by Jan)
41 | and "rpm ready" install logic.
42 |
43 | Release 1.2.7: 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.
46 |
47 | Release 1.2.6: 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.
50 |
51 | Release 1.2.5: 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.
54 |
55 | Release 1.2.4: 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.
59 |
60 | Release 1.2.3: 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.
65 |
66 | Release 1.2.2: Added proper support for multipatch (reading and
67 | writing) - this release just for testing purposes.
68 |
69 | Release 1.2 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.
73 |
74 | Release V1.1 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.