Revision: 76813 http://sourceforge.net/p/brlcad/code/76813 Author: starseeker Date: 2020-08-17 02:56:07 +0000 (Mon, 17 Aug 2020) Log Message: ----------- See if collapsing ogr into its own lib helps... may be too big by itself
Modified Paths: -------------- brlcad/trunk/src/other/gdal/CMakeLists.txt brlcad/trunk/src/other/gdal/apps/CMakeLists.txt brlcad/trunk/src/other/gdal/frmts/grcdataset.cpp brlcad/trunk/src/other/gdal/frmts/grddataset.cpp brlcad/trunk/src/other/gdal/gcore/CMakeLists.txt brlcad/trunk/src/other/gdal/ogr/CMakeLists.txt brlcad/trunk/src/other/gdal/ogr/gml2ogrgeometry.cpp brlcad/trunk/src/other/gdal/ogr/ogr_geocoding.cpp brlcad/trunk/src/other/gdal/ogr/ogr_json_header.h brlcad/trunk/src/other/gdal.dist Added Paths: ----------- brlcad/trunk/src/other/gdal/ogr/COPYING brlcad/trunk/src/other/gdal/ogr/README.txt brlcad/trunk/src/other/gdal/ogr/avc.h brlcad/trunk/src/other/gdal/ogr/avc_bin.c brlcad/trunk/src/other/gdal/ogr/avc_binwr.c brlcad/trunk/src/other/gdal/ogr/avc_e00gen.c brlcad/trunk/src/other/gdal/ogr/avc_e00parse.c brlcad/trunk/src/other/gdal/ogr/avc_e00read.c brlcad/trunk/src/other/gdal/ogr/avc_e00write.c brlcad/trunk/src/other/gdal/ogr/avc_mbyte.c brlcad/trunk/src/other/gdal/ogr/avc_mbyte.h brlcad/trunk/src/other/gdal/ogr/avc_misc.c brlcad/trunk/src/other/gdal/ogr/avc_rawbin.c brlcad/trunk/src/other/gdal/ogr/dbfopen.c brlcad/trunk/src/other/gdal/ogr/ddfrecordindex.cpp brlcad/trunk/src/other/gdal/ogr/dgnfloat.cpp brlcad/trunk/src/other/gdal/ogr/dgnhelp.cpp brlcad/trunk/src/other/gdal/ogr/dgnlib.h brlcad/trunk/src/other/gdal/ogr/dgnlibp.h brlcad/trunk/src/other/gdal/ogr/dgnopen.cpp brlcad/trunk/src/other/gdal/ogr/dgnread.cpp brlcad/trunk/src/other/gdal/ogr/dgnstroke.cpp brlcad/trunk/src/other/gdal/ogr/dgnwrite.cpp brlcad/trunk/src/other/gdal/ogr/dist/ brlcad/trunk/src/other/gdal/ogr/filegdbindex.cpp brlcad/trunk/src/other/gdal/ogr/filegdbtable.cpp brlcad/trunk/src/other/gdal/ogr/filegdbtable.h brlcad/trunk/src/other/gdal/ogr/filegdbtable_priv.h brlcad/trunk/src/other/gdal/ogr/gdaldb2rasterband.cpp brlcad/trunk/src/other/gdal/ogr/geoconcept.c brlcad/trunk/src/other/gdal/ogr/geoconcept.h brlcad/trunk/src/other/gdal/ogr/geoconcept_syscoord.c brlcad/trunk/src/other/gdal/ogr/geoconcept_syscoord.h brlcad/trunk/src/other/gdal/ogr/gtm.cpp brlcad/trunk/src/other/gdal/ogr/gtm.h brlcad/trunk/src/other/gdal/ogr/gtmtracklayer.cpp brlcad/trunk/src/other/gdal/ogr/gtmwaypointlayer.cpp brlcad/trunk/src/other/gdal/ogr/intronurbs.cpp brlcad/trunk/src/other/gdal/ogr/io_selafin.cpp brlcad/trunk/src/other/gdal/ogr/io_selafin.h brlcad/trunk/src/other/gdal/ogr/libjson/ brlcad/trunk/src/other/gdal/ogr/ll_recio.cpp brlcad/trunk/src/other/gdal/ogr/mitab.h brlcad/trunk/src/other/gdal/ogr/mitab_bounds.cpp brlcad/trunk/src/other/gdal/ogr/mitab_coordsys.cpp brlcad/trunk/src/other/gdal/ogr/mitab_datfile.cpp brlcad/trunk/src/other/gdal/ogr/mitab_feature.cpp brlcad/trunk/src/other/gdal/ogr/mitab_feature_mif.cpp brlcad/trunk/src/other/gdal/ogr/mitab_geometry.cpp brlcad/trunk/src/other/gdal/ogr/mitab_geometry.h brlcad/trunk/src/other/gdal/ogr/mitab_idfile.cpp brlcad/trunk/src/other/gdal/ogr/mitab_imapinfofile.cpp brlcad/trunk/src/other/gdal/ogr/mitab_indfile.cpp brlcad/trunk/src/other/gdal/ogr/mitab_mapcoordblock.cpp brlcad/trunk/src/other/gdal/ogr/mitab_mapfile.cpp brlcad/trunk/src/other/gdal/ogr/mitab_mapheaderblock.cpp brlcad/trunk/src/other/gdal/ogr/mitab_mapindexblock.cpp brlcad/trunk/src/other/gdal/ogr/mitab_mapobjectblock.cpp brlcad/trunk/src/other/gdal/ogr/mitab_maptoolblock.cpp brlcad/trunk/src/other/gdal/ogr/mitab_middatafile.cpp brlcad/trunk/src/other/gdal/ogr/mitab_miffile.cpp brlcad/trunk/src/other/gdal/ogr/mitab_ogr_datasource.cpp brlcad/trunk/src/other/gdal/ogr/mitab_ogr_driver.cpp brlcad/trunk/src/other/gdal/ogr/mitab_ogr_driver.h brlcad/trunk/src/other/gdal/ogr/mitab_priv.h brlcad/trunk/src/other/gdal/ogr/mitab_rawbinblock.cpp brlcad/trunk/src/other/gdal/ogr/mitab_spatialref.cpp brlcad/trunk/src/other/gdal/ogr/mitab_tabfile.cpp brlcad/trunk/src/other/gdal/ogr/mitab_tabseamless.cpp brlcad/trunk/src/other/gdal/ogr/mitab_tabview.cpp brlcad/trunk/src/other/gdal/ogr/mitab_tooldef.cpp brlcad/trunk/src/other/gdal/ogr/mitab_utils.cpp brlcad/trunk/src/other/gdal/ogr/mitab_utils.h brlcad/trunk/src/other/gdal/ogr/ntf.h brlcad/trunk/src/other/gdal/ogr/ntf_codelist.cpp brlcad/trunk/src/other/gdal/ogr/ntf_estlayers.cpp brlcad/trunk/src/other/gdal/ogr/ntf_generic.cpp brlcad/trunk/src/other/gdal/ogr/ntf_raster.cpp brlcad/trunk/src/other/gdal/ogr/ntffilereader.cpp brlcad/trunk/src/other/gdal/ogr/ntfrecord.cpp brlcad/trunk/src/other/gdal/ogr/ntfstroke.cpp brlcad/trunk/src/other/gdal/ogr/ogr_aeronavfaa.h brlcad/trunk/src/other/gdal/ogr/ogr_arcgen.h brlcad/trunk/src/other/gdal/ogr/ogr_attrind.cpp brlcad/trunk/src/other/gdal/ogr/ogr_attrind.h brlcad/trunk/src/other/gdal/ogr/ogr_autocad_services.cpp brlcad/trunk/src/other/gdal/ogr/ogr_autocad_services.h brlcad/trunk/src/other/gdal/ogr/ogr_avc.h brlcad/trunk/src/other/gdal/ogr/ogr_bna.h brlcad/trunk/src/other/gdal/ogr/ogr_csv.h brlcad/trunk/src/other/gdal/ogr/ogr_db2.h brlcad/trunk/src/other/gdal/ogr/ogr_dgn.h brlcad/trunk/src/other/gdal/ogr/ogr_dxf.h brlcad/trunk/src/other/gdal/ogr/ogr_edigeo.h brlcad/trunk/src/other/gdal/ogr/ogr_gensql.cpp brlcad/trunk/src/other/gdal/ogr/ogr_gensql.h brlcad/trunk/src/other/gdal/ogr/ogr_geojson.h brlcad/trunk/src/other/gdal/ogr/ogr_gmt.h brlcad/trunk/src/other/gdal/ogr/ogr_gpsbabel.h brlcad/trunk/src/other/gdal/ogr/ogr_gtm.h brlcad/trunk/src/other/gdal/ogr/ogr_htf.h brlcad/trunk/src/other/gdal/ogr/ogr_idrisi.h brlcad/trunk/src/other/gdal/ogr/ogr_mem.h brlcad/trunk/src/other/gdal/ogr/ogr_miattrind.cpp brlcad/trunk/src/other/gdal/ogr/ogr_openair.h brlcad/trunk/src/other/gdal/ogr/ogr_openfilegdb.h brlcad/trunk/src/other/gdal/ogr/ogr_pds.h brlcad/trunk/src/other/gdal/ogr/ogr_pgdump.h brlcad/trunk/src/other/gdal/ogr/ogr_rec.h brlcad/trunk/src/other/gdal/ogr/ogr_s57.h brlcad/trunk/src/other/gdal/ogr/ogr_segukooa.h brlcad/trunk/src/other/gdal/ogr/ogr_segy.h brlcad/trunk/src/other/gdal/ogr/ogr_selafin.h brlcad/trunk/src/other/gdal/ogr/ogr_sua.h brlcad/trunk/src/other/gdal/ogr/ogr_sxf.h brlcad/trunk/src/other/gdal/ogr/ogr_tiger.h brlcad/trunk/src/other/gdal/ogr/ogr_vdv.h brlcad/trunk/src/other/gdal/ogr/ogr_vrt.h brlcad/trunk/src/other/gdal/ogr/ogr_xplane.h brlcad/trunk/src/other/gdal/ogr/ogr_xplane_apt_reader.cpp brlcad/trunk/src/other/gdal/ogr/ogr_xplane_apt_reader.h brlcad/trunk/src/other/gdal/ogr/ogr_xplane_awy_reader.cpp brlcad/trunk/src/other/gdal/ogr/ogr_xplane_awy_reader.h brlcad/trunk/src/other/gdal/ogr/ogr_xplane_fix_reader.cpp brlcad/trunk/src/other/gdal/ogr/ogr_xplane_fix_reader.h brlcad/trunk/src/other/gdal/ogr/ogr_xplane_geo_utils.cpp brlcad/trunk/src/other/gdal/ogr/ogr_xplane_geo_utils.h brlcad/trunk/src/other/gdal/ogr/ogr_xplane_nav_reader.cpp brlcad/trunk/src/other/gdal/ogr/ogr_xplane_nav_reader.h brlcad/trunk/src/other/gdal/ogr/ogr_xplane_reader.cpp brlcad/trunk/src/other/gdal/ogr/ogr_xplane_reader.h brlcad/trunk/src/other/gdal/ogr/ograeronavfaadatasource.cpp brlcad/trunk/src/other/gdal/ogr/ograeronavfaadriver.cpp brlcad/trunk/src/other/gdal/ogr/ograeronavfaalayer.cpp brlcad/trunk/src/other/gdal/ogr/ograrcgendatasource.cpp brlcad/trunk/src/other/gdal/ogr/ograrcgendriver.cpp brlcad/trunk/src/other/gdal/ogr/ograrcgenlayer.cpp brlcad/trunk/src/other/gdal/ogr/ogravcbindatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogravcbindriver.cpp brlcad/trunk/src/other/gdal/ogr/ogravcbinlayer.cpp brlcad/trunk/src/other/gdal/ogr/ogravcdatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogravce00datasource.cpp brlcad/trunk/src/other/gdal/ogr/ogravce00driver.cpp brlcad/trunk/src/other/gdal/ogr/ogravce00layer.cpp brlcad/trunk/src/other/gdal/ogr/ogravclayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrbnadatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogrbnadriver.cpp brlcad/trunk/src/other/gdal/ogr/ogrbnalayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrbnaparser.cpp brlcad/trunk/src/other/gdal/ogr/ogrbnaparser.h brlcad/trunk/src/other/gdal/ogr/ogrcsvdatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogrcsvdriver.cpp brlcad/trunk/src/other/gdal/ogr/ogrcsvlayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrdatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogrdb2cli.cpp brlcad/trunk/src/other/gdal/ogr/ogrdb2datasource.cpp brlcad/trunk/src/other/gdal/ogr/ogrdb2datasourcemd.cpp brlcad/trunk/src/other/gdal/ogr/ogrdb2driver.cpp brlcad/trunk/src/other/gdal/ogr/ogrdb2geometryvalidator.cpp brlcad/trunk/src/other/gdal/ogr/ogrdb2layer.cpp brlcad/trunk/src/other/gdal/ogr/ogrdb2selectlayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrdb2tablelayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrdgndatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogrdgndriver.cpp brlcad/trunk/src/other/gdal/ogr/ogrdgnlayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrdxf_blockmap.cpp brlcad/trunk/src/other/gdal/ogr/ogrdxf_dimension.cpp brlcad/trunk/src/other/gdal/ogr/ogrdxf_hatch.cpp brlcad/trunk/src/other/gdal/ogr/ogrdxf_polyline_smooth.cpp brlcad/trunk/src/other/gdal/ogr/ogrdxf_polyline_smooth.h brlcad/trunk/src/other/gdal/ogr/ogrdxfblockslayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrdxfblockswriterlayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrdxfdatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogrdxfdriver.cpp brlcad/trunk/src/other/gdal/ogr/ogrdxflayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrdxfreader.cpp brlcad/trunk/src/other/gdal/ogr/ogrdxfwriterds.cpp brlcad/trunk/src/other/gdal/ogr/ogrdxfwriterlayer.cpp brlcad/trunk/src/other/gdal/ogr/ogredigeodatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogredigeodriver.cpp brlcad/trunk/src/other/gdal/ogr/ogredigeolayer.cpp brlcad/trunk/src/other/gdal/ogr/ogreditablelayer.cpp brlcad/trunk/src/other/gdal/ogr/ogreditablelayer.h brlcad/trunk/src/other/gdal/ogr/ogremulatedtransaction.cpp brlcad/trunk/src/other/gdal/ogr/ogremulatedtransaction.h brlcad/trunk/src/other/gdal/ogr/ogresrijsonreader.cpp brlcad/trunk/src/other/gdal/ogr/ogrgeoconceptdatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogrgeoconceptdatasource.h brlcad/trunk/src/other/gdal/ogr/ogrgeoconceptdriver.cpp brlcad/trunk/src/other/gdal/ogr/ogrgeoconceptdriver.h brlcad/trunk/src/other/gdal/ogr/ogrgeoconceptlayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrgeoconceptlayer.h brlcad/trunk/src/other/gdal/ogr/ogrgeojsondatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogrgeojsondriver.cpp brlcad/trunk/src/other/gdal/ogr/ogrgeojsonlayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrgeojsonreader.cpp brlcad/trunk/src/other/gdal/ogr/ogrgeojsonreader.h brlcad/trunk/src/other/gdal/ogr/ogrgeojsonutils.cpp brlcad/trunk/src/other/gdal/ogr/ogrgeojsonutils.h brlcad/trunk/src/other/gdal/ogr/ogrgeojsonwritelayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrgeojsonwriter.cpp brlcad/trunk/src/other/gdal/ogr/ogrgeojsonwriter.h brlcad/trunk/src/other/gdal/ogr/ogrgmtdatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogrgmtdriver.cpp brlcad/trunk/src/other/gdal/ogr/ogrgmtlayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrgpsbabeldatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogrgpsbabeldriver.cpp brlcad/trunk/src/other/gdal/ogr/ogrgpsbabelwritedatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogrgtmdatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogrgtmdriver.cpp brlcad/trunk/src/other/gdal/ogr/ogrgtmlayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrhtfdatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogrhtfdriver.cpp brlcad/trunk/src/other/gdal/ogr/ogrhtflayer.cpp brlcad/trunk/src/other/gdal/ogr/ogridrisidatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogridrisidriver.cpp brlcad/trunk/src/other/gdal/ogr/ogridrisilayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrlayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrlayerdecorator.cpp brlcad/trunk/src/other/gdal/ogr/ogrlayerdecorator.h brlcad/trunk/src/other/gdal/ogr/ogrlayerpool.cpp brlcad/trunk/src/other/gdal/ogr/ogrlayerpool.h brlcad/trunk/src/other/gdal/ogr/ogrmemdatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogrmemdriver.cpp brlcad/trunk/src/other/gdal/ogr/ogrmemlayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrmutexeddatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogrmutexeddatasource.h brlcad/trunk/src/other/gdal/ogr/ogrmutexedlayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrmutexedlayer.h brlcad/trunk/src/other/gdal/ogr/ogrntfdatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogrntfdriver.cpp brlcad/trunk/src/other/gdal/ogr/ogrntffeatureclasslayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrntflayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrnulldriver.cpp brlcad/trunk/src/other/gdal/ogr/ogropenairdatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogropenairdriver.cpp brlcad/trunk/src/other/gdal/ogr/ogropenairlabellayer.cpp brlcad/trunk/src/other/gdal/ogr/ogropenairlayer.cpp brlcad/trunk/src/other/gdal/ogr/ogropenfilegdbdatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogropenfilegdbdriver.cpp brlcad/trunk/src/other/gdal/ogr/ogropenfilegdblayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrpdsdatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogrpdsdriver.cpp brlcad/trunk/src/other/gdal/ogr/ogrpdslayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrpgdumpdatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogrpgdumpdriver.cpp brlcad/trunk/src/other/gdal/ogr/ogrpgdumplayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrrecdatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogrrecdriver.cpp brlcad/trunk/src/other/gdal/ogr/ogrreclayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrregisterall.cpp brlcad/trunk/src/other/gdal/ogr/ogrs57datasource.cpp brlcad/trunk/src/other/gdal/ogr/ogrs57driver.cpp brlcad/trunk/src/other/gdal/ogr/ogrs57layer.cpp brlcad/trunk/src/other/gdal/ogr/ogrsegukooadatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogrsegukooadriver.cpp brlcad/trunk/src/other/gdal/ogr/ogrsegukooalayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrsegydatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogrsegydriver.cpp brlcad/trunk/src/other/gdal/ogr/ogrsegylayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrselafindatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogrselafindriver.cpp brlcad/trunk/src/other/gdal/ogr/ogrselafinlayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrsf_frmts.h brlcad/trunk/src/other/gdal/ogr/ogrsfdriver.cpp brlcad/trunk/src/other/gdal/ogr/ogrsfdriverregistrar.cpp brlcad/trunk/src/other/gdal/ogr/ogrshape.h brlcad/trunk/src/other/gdal/ogr/ogrshapedatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogrshapedriver.cpp brlcad/trunk/src/other/gdal/ogr/ogrshapelayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrsuadatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogrsuadriver.cpp brlcad/trunk/src/other/gdal/ogr/ogrsualayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrsxfdatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogrsxfdriver.cpp brlcad/trunk/src/other/gdal/ogr/ogrsxflayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrtigerdatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogrtigerdriver.cpp brlcad/trunk/src/other/gdal/ogr/ogrtigerlayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrtopojsonreader.cpp brlcad/trunk/src/other/gdal/ogr/ogrunionlayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrunionlayer.h brlcad/trunk/src/other/gdal/ogr/ogrvdvdatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogrvrtdatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogrvrtdriver.cpp brlcad/trunk/src/other/gdal/ogr/ogrvrtlayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrwarpedlayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrwarpedlayer.h brlcad/trunk/src/other/gdal/ogr/ogrwasp.h brlcad/trunk/src/other/gdal/ogr/ogrwaspdatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogrwaspdriver.cpp brlcad/trunk/src/other/gdal/ogr/ogrwasplayer.cpp brlcad/trunk/src/other/gdal/ogr/ogrxplanedatasource.cpp brlcad/trunk/src/other/gdal/ogr/ogrxplanedriver.cpp brlcad/trunk/src/other/gdal/ogr/ogrxplanelayer.cpp brlcad/trunk/src/other/gdal/ogr/org_sxf_defs.h brlcad/trunk/src/other/gdal/ogr/s57.h brlcad/trunk/src/other/gdal/ogr/s57classregistrar.cpp brlcad/trunk/src/other/gdal/ogr/s57featuredefns.cpp brlcad/trunk/src/other/gdal/ogr/s57filecollector.cpp brlcad/trunk/src/other/gdal/ogr/s57reader.cpp brlcad/trunk/src/other/gdal/ogr/s57tables.h brlcad/trunk/src/other/gdal/ogr/s57writer.cpp brlcad/trunk/src/other/gdal/ogr/sbnsearch.c brlcad/trunk/src/other/gdal/ogr/segukooa.txt brlcad/trunk/src/other/gdal/ogr/segy.txt brlcad/trunk/src/other/gdal/ogr/shape2ogr.cpp brlcad/trunk/src/other/gdal/ogr/shapefil.h brlcad/trunk/src/other/gdal/ogr/shp_vsi.c brlcad/trunk/src/other/gdal/ogr/shp_vsi.h brlcad/trunk/src/other/gdal/ogr/shpopen.c brlcad/trunk/src/other/gdal/ogr/shptree.c brlcad/trunk/src/other/gdal/ogr/tigeraltname.cpp brlcad/trunk/src/other/gdal/ogr/tigerarealandmarks.cpp brlcad/trunk/src/other/gdal/ogr/tigercompletechain.cpp brlcad/trunk/src/other/gdal/ogr/tigerentitynames.cpp brlcad/trunk/src/other/gdal/ogr/tigerfeatureids.cpp brlcad/trunk/src/other/gdal/ogr/tigerfilebase.cpp brlcad/trunk/src/other/gdal/ogr/tigeridhistory.cpp brlcad/trunk/src/other/gdal/ogr/tigerkeyfeatures.cpp brlcad/trunk/src/other/gdal/ogr/tigerlandmarks.cpp brlcad/trunk/src/other/gdal/ogr/tigeroverunder.cpp brlcad/trunk/src/other/gdal/ogr/tigerpip.cpp brlcad/trunk/src/other/gdal/ogr/tigerpoint.cpp brlcad/trunk/src/other/gdal/ogr/tigerpolychainlink.cpp brlcad/trunk/src/other/gdal/ogr/tigerpolygon.cpp brlcad/trunk/src/other/gdal/ogr/tigerpolygoncorrections.cpp brlcad/trunk/src/other/gdal/ogr/tigerpolygoneconomic.cpp brlcad/trunk/src/other/gdal/ogr/tigerspatialmetadata.cpp brlcad/trunk/src/other/gdal/ogr/tigertlidrange.cpp brlcad/trunk/src/other/gdal/ogr/tigerzerocellid.cpp brlcad/trunk/src/other/gdal/ogr/tigerzipcodes.cpp brlcad/trunk/src/other/gdal/ogr/tigerzipplus4.cpp brlcad/trunk/src/other/gdal/ogr/web/ Removed Paths: ------------- brlcad/trunk/src/other/gdal/ogr/ogrsf_frmts/ Modified: brlcad/trunk/src/other/gdal/CMakeLists.txt =================================================================== --- brlcad/trunk/src/other/gdal/CMakeLists.txt 2020-08-17 02:10:56 UTC (rev 76812) +++ brlcad/trunk/src/other/gdal/CMakeLists.txt 2020-08-17 02:56:07 UTC (rev 76813) @@ -341,17 +341,9 @@ $<TARGET_OBJECTS:gdal_mdreader_obj> $<TARGET_OBJECTS:gdal_gcore_obj> $<TARGET_OBJECTS:gdal_alg_obj> - $<TARGET_OBJECTS:libtiff_obj> - $<TARGET_OBJECTS:libgeotiff_obj> - $<TARGET_OBJECTS:json_obj> - $<TARGET_OBJECTS:gdal_ogr_obj> $<TARGET_OBJECTS:gdal_gnm_obj> $<TARGET_OBJECTS:gdal_apps_obj> ) -foreach(frmt ${OGR_FORMATS}) - set(gdal_srcs ${gdal_srcs} $<TARGET_OBJECTS:ogr_frmt_${frmt}>) - set_target_properties(ogr_frmt_${frmt} PROPERTIES FOLDER "Third Party Libraries/GDAL") -endforeach(frmt ${OGR_FORMATS}) set(gdal_libs ${PROJ4_LIBRARIES} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) set(lib_list M DL ICONV) @@ -365,7 +357,7 @@ endif(MSVC) add_library(gdal SHARED ${gdal_srcs}) -target_link_libraries(gdal gdal_frmts ${gdal_libs}) +target_link_libraries(gdal gdal_frmts gdal_ogr ${gdal_libs}) install(TARGETS gdal RUNTIME DESTINATION ${BIN_DIR} LIBRARY DESTINATION ${LIB_DIR} Modified: brlcad/trunk/src/other/gdal/apps/CMakeLists.txt =================================================================== --- brlcad/trunk/src/other/gdal/apps/CMakeLists.txt 2020-08-17 02:10:56 UTC (rev 76812) +++ brlcad/trunk/src/other/gdal/apps/CMakeLists.txt 2020-08-17 02:56:07 UTC (rev 76813) @@ -2,9 +2,8 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../frmts - ${CMAKE_CURRENT_SOURCE_DIR}/../ogr/ogrsf_frmts/geojson/libjson - ${CMAKE_CURRENT_SOURCE_DIR}/../ogr/ogrsf_frmts/geojson - ${CMAKE_CURRENT_SOURCE_DIR}/../ogr/ogrsf_frmts/generic + ${CMAKE_CURRENT_SOURCE_DIR}/../ogr/libjson + ${CMAKE_CURRENT_SOURCE_DIR}/../ogr ) set(apps_srcs Modified: brlcad/trunk/src/other/gdal/frmts/grcdataset.cpp =================================================================== --- brlcad/trunk/src/other/gdal/frmts/grcdataset.cpp 2020-08-17 02:10:56 UTC (rev 76812) +++ brlcad/trunk/src/other/gdal/frmts/grcdataset.cpp 2020-08-17 02:56:07 UTC (rev 76813) @@ -30,13 +30,8 @@ #include "gdal_frmts.h" #include "gdal_pam.h" #include "northwood.h" +#include "../ogr/mitab.h" -#ifdef MSVC -#include "..\..\ogr\ogrsf_frmts\mitab\mitab.h" -#else -#include "../../ogr/ogrsf_frmts/mitab/mitab.h" -#endif - CPL_CVSID("$Id: grcdataset.cpp 38727 2017-05-31 17:50:31Z dmorissette $"); /************************************************************************/ Modified: brlcad/trunk/src/other/gdal/frmts/grddataset.cpp =================================================================== --- brlcad/trunk/src/other/gdal/frmts/grddataset.cpp 2020-08-17 02:10:56 UTC (rev 76812) +++ brlcad/trunk/src/other/gdal/frmts/grddataset.cpp 2020-08-17 02:56:07 UTC (rev 76813) @@ -34,13 +34,8 @@ #include "gdal_frmts.h" #include "gdal_pam.h" #include "northwood.h" +#include "../ogr/mitab.h" -#ifdef MSVC -#include "..\..\ogr\ogrsf_frmts\mitab\mitab.h" -#else -#include "../../ogr/ogrsf_frmts/mitab/mitab.h" -#endif - CPL_CVSID("$Id: grddataset.cpp 36501 2016-11-25 14:09:24Z rouault $"); #define NODATA -1.e37f Modified: brlcad/trunk/src/other/gdal/gcore/CMakeLists.txt =================================================================== --- brlcad/trunk/src/other/gdal/gcore/CMakeLists.txt 2020-08-17 02:10:56 UTC (rev 76812) +++ brlcad/trunk/src/other/gdal/gcore/CMakeLists.txt 2020-08-17 02:56:07 UTC (rev 76813) @@ -2,13 +2,11 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../frmts - ${CMAKE_CURRENT_SOURCE_DIR}/../ogr/ogrsf_frmts/generic + ${CMAKE_CURRENT_SOURCE_DIR}/../ogr ${CMAKE_CURRENT_SOURCE_DIR}/../gnm/gnm_frmts - ${CMAKE_CURRENT_SOURCE_DIR}/../ogr/ogrsf_frmts/geojson/libjson - ${CMAKE_CURRENT_SOURCE_DIR}/../ogr/ogrsf_frmts/geojson + ${CMAKE_CURRENT_SOURCE_DIR}/../ogr/libjson ) - set(gcore_srcs gdalopeninfo.cpp gdaldrivermanager.cpp Modified: brlcad/trunk/src/other/gdal/ogr/CMakeLists.txt =================================================================== --- brlcad/trunk/src/other/gdal/ogr/CMakeLists.txt 2020-08-17 02:10:56 UTC (rev 76812) +++ brlcad/trunk/src/other/gdal/ogr/CMakeLists.txt 2020-08-17 02:56:07 UTC (rev 76813) @@ -1,80 +1,297 @@ +add_subdirectory(libjson) -add_subdirectory(ogrsf_frmts) - include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/ogrsf_frmts - ${CMAKE_CURRENT_SOURCE_DIR}/ogrsf_frmts/mem - ${CMAKE_CURRENT_SOURCE_DIR}/ogrsf_frmts/geojson - ${CMAKE_CURRENT_SOURCE_DIR}/ogrsf_frmts/geojson/libjson - ) + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/../frmts + ${CMAKE_CURRENT_SOURCE_DIR}/libjson + ) +set(ogr_frmt_srcs + ograeronavfaadriver.cpp ograeronavfaadatasource.cpp ograeronavfaalayer.cpp + ograrcgendriver.cpp ograrcgendatasource.cpp ograrcgenlayer.cpp + avc_bin.c + avc_binwr.c + avc_e00gen.c + avc_e00parse.c + avc_e00write.c + avc_e00read.c + avc_mbyte.c + avc_misc.c + avc_rawbin.c + ogravcbindriver.cpp + ogravcbindatasource.cpp + ogravcbinlayer.cpp + ogravclayer.cpp + ogravcdatasource.cpp + ogravce00layer.cpp + ogravce00datasource.cpp + ogravce00driver.cpp + ogrbnadriver.cpp ogrbnadatasource.cpp ogrbnalayer.cpp ogrbnaparser.cpp + ogrcsvdriver.cpp ogrcsvdatasource.cpp ogrcsvlayer.cpp + ogrdgndriver.cpp + ogrdgndatasource.cpp + ogrdgnlayer.cpp + dgnopen.cpp + dgnread.cpp + dgnfloat.cpp + dgnhelp.cpp + dgnwrite.cpp + dgnstroke.cpp + ogrdxfdriver.cpp + ogrdxfdatasource.cpp + ogrdxflayer.cpp + ogrdxfreader.cpp + ogrdxf_blockmap.cpp + ogrdxf_dimension.cpp + ogrdxfwriterds.cpp + ogrdxfwriterlayer.cpp + intronurbs.cpp + ogrdxf_polyline_smooth.cpp + ogrdxfblockslayer.cpp + ogrdxfblockswriterlayer.cpp + ogrdxf_hatch.cpp + ogr_autocad_services.cpp + ogredigeodriver.cpp ogredigeodatasource.cpp ogredigeolayer.cpp + ogrsfdriverregistrar.cpp + ogrlayer.cpp + ogrdatasource.cpp + ogrsfdriver.cpp + ogrregisterall.cpp + ogr_gensql.cpp + ogr_attrind.cpp + ogr_miattrind.cpp + ogrlayerdecorator.cpp + ogrwarpedlayer.cpp + ogrunionlayer.cpp + ogrlayerpool.cpp + ogrmutexedlayer.cpp + ogrmutexeddatasource.cpp + ogremulatedtransaction.cpp + ogreditablelayer.cpp + geoconcept.c + geoconcept_syscoord.c + ogrgeoconceptdriver.cpp + ogrgeoconceptdatasource.cpp + ogrgeoconceptlayer.cpp + ogrgeojsondriver.cpp + ogrgeojsondatasource.cpp + ogrgeojsonlayer.cpp + ogrgeojsonwritelayer.cpp + ogrgeojsonutils.cpp + ogrgeojsonreader.cpp + ogrgeojsonwriter.cpp + ogresrijsonreader.cpp + ogrtopojsonreader.cpp + ogrgmtdriver.cpp ogrgmtdatasource.cpp ogrgmtlayer.cpp + ogrgpsbabeldriver.cpp ogrgpsbabeldatasource.cpp ogrgpsbabelwritedatasource.cpp + ogrgtmdriver.cpp + ogrgtmdatasource.cpp + ogrgtmlayer.cpp + gtm.cpp + gtmwaypointlayer.cpp + gtmtracklayer.cpp + + ogrhtfdriver.cpp ogrhtfdatasource.cpp ogrhtflayer.cpp + ogridrisidriver.cpp ogridrisidatasource.cpp ogridrisilayer.cpp + ogrmemdriver.cpp ogrmemdatasource.cpp ogrmemlayer.cpp + mitab_rawbinblock.cpp + mitab_mapheaderblock.cpp + mitab_mapindexblock.cpp + mitab_mapobjectblock.cpp + mitab_mapcoordblock.cpp + mitab_feature.cpp + mitab_feature_mif.cpp + mitab_mapfile.cpp + mitab_idfile.cpp + mitab_datfile.cpp + mitab_tabfile.cpp + mitab_miffile.cpp + mitab_utils.cpp + mitab_imapinfofile.cpp + mitab_middatafile.cpp + mitab_bounds.cpp + mitab_maptoolblock.cpp + mitab_tooldef.cpp + mitab_coordsys.cpp + mitab_spatialref.cpp + mitab_ogr_driver.cpp + mitab_indfile.cpp + mitab_tabview.cpp + mitab_ogr_datasource.cpp + mitab_geometry.cpp + mitab_tabseamless.cpp + ntffilereader.cpp + ntfrecord.cpp + ogrntfdatasource.cpp + ogrntfdriver.cpp + ogrntflayer.cpp + ntf_estlayers.cpp + ogrntffeatureclasslayer.cpp + ntf_generic.cpp + ntf_raster.cpp + ntf_codelist.cpp + ntfstroke.cpp + ogropenairdriver.cpp + ogropenairdatasource.cpp + ogropenairlayer.cpp + ogropenairlabellayer.cpp + ogropenfilegdbdriver.cpp + ogropenfilegdbdatasource.cpp + ogropenfilegdblayer.cpp + filegdbtable.cpp + filegdbindex.cpp + ogrpdsdriver.cpp ogrpdsdatasource.cpp ogrpdslayer.cpp + ogrpgdumpdriver.cpp ogrpgdumpdatasource.cpp ogrpgdumplayer.cpp + ogrrecdriver.cpp ogrrecdatasource.cpp ogrreclayer.cpp ll_recio.cpp + ogrs57driver.cpp + ogrs57datasource.cpp + ogrs57layer.cpp + s57reader.cpp + s57writer.cpp + ddfrecordindex.cpp + s57classregistrar.cpp + s57filecollector.cpp + s57featuredefns.cpp + ogrsegukooadriver.cpp ogrsegukooadatasource.cpp ogrsegukooalayer.cpp + ogrsegydriver.cpp ogrsegydatasource.cpp ogrsegylayer.cpp + ogrselafindriver.cpp ogrselafindatasource.cpp ogrselafinlayer.cpp io_selafin.cpp + shape2ogr.cpp + shpopen.c + dbfopen.c + shptree.c + sbnsearch.c + shp_vsi.c + ogrshapedriver.cpp + ogrshapedatasource.cpp + ogrshapelayer.cpp + ogrsuadriver.cpp ogrsuadatasource.cpp ogrsualayer.cpp + ogrsxfdriver.cpp ogrsxfdatasource.cpp ogrsxflayer.cpp + ogrtigerdriver.cpp + ogrtigerdatasource.cpp + ogrtigerlayer.cpp + tigerfilebase.cpp + tigercompletechain.cpp + tigeraltname.cpp + tigerfeatureids.cpp + tigerzipcodes.cpp + tigerlandmarks.cpp + tigerarealandmarks.cpp + tigerkeyfeatures.cpp + tigerpolygon.cpp + tigerpolygoncorrections.cpp + tigerentitynames.cpp + tigerpolygoneconomic.cpp + tigeridhistory.cpp + tigerpolychainlink.cpp + tigerpip.cpp + tigerspatialmetadata.cpp + tigertlidrange.cpp + tigerzerocellid.cpp + tigeroverunder.cpp + tigerzipplus4.cpp + tigerpoint.cpp + ogrvdvdatasource.cpp + ogrvrtdatasource.cpp ogrvrtlayer.cpp ogrvrtdriver.cpp + ogrwaspdriver.cpp ogrwaspdatasource.cpp ogrwasplayer.cpp + ogrxplanedriver.cpp + ogrxplanedatasource.cpp + ogrxplanelayer.cpp + ogr_xplane_geo_utils.cpp + ogr_xplane_reader.cpp + ogr_xplane_apt_reader.cpp + ogr_xplane_nav_reader.cpp + ogr_xplane_fix_reader.cpp + ogr_xplane_awy_reader.cpp + ) + set(ogr_srcs - ogrgeometryfactory.cpp - ogrpoint.cpp - ogrcurve.cpp - ogrlinestring.cpp - ogrlinearring.cpp - ogrpolygon.cpp - ogrtriangle.cpp - ogrutils.cpp - ogrgeometry.cpp - ogrgeometrycollection.cpp - ogrmultipolygon.cpp - ogrsurface.cpp - ogrpolyhedralsurface.cpp - ogrtriangulatedsurface.cpp - ogrmultipoint.cpp - ogrmultilinestring.cpp - ogrcircularstring.cpp - ogrcompoundcurve.cpp - ogrcurvepolygon.cpp - ogrcurvecollection.cpp - ogrmulticurve.cpp - ogrmultisurface.cpp - ogr_api.cpp - ogrfeature.cpp - ogrfeaturedefn.cpp - ogrfeaturequery.cpp - ogrfeaturestyle.cpp - ogrfielddefn.cpp - ogrspatialreference.cpp - ogr_srsnode.cpp - ogr_srs_proj4.cpp - ogr_fromepsg.cpp - ogrct.cpp - ogr_opt.cpp - ogr_srs_esri.cpp - ogr_srs_pci.cpp - ogr_srs_usgs.cpp - ogr_srs_dict.cpp - ogr_srs_panorama.cpp - ogr_srs_ozi.cpp - ogr_srs_erm.cpp - swq.cpp - swq_expr_node.cpp - swq_parser.cpp - swq_select.cpp - swq_op_registrar.cpp - swq_op_general.cpp - ogr_srs_validate.cpp - ogr_srs_xml.cpp - ograssemblepolygon.cpp - ogr2gmlgeometry.cpp - gml2ogrgeometry.cpp - ogr_expat.cpp - ogrpgeogeometry.cpp - ogrgeomediageometry.cpp - ogr_geocoding.cpp - osr_cs_wkt.c - osr_cs_wkt_parser.c - ogrgeomfielddefn.cpp - ograpispy.cpp - ogr_xerces.cpp - ) + ${ogr_frmt_srcs} + ogrgeometryfactory.cpp + ogrpoint.cpp + ogrcurve.cpp + ogrlinestring.cpp + ogrlinearring.cpp + ogrpolygon.cpp + ogrtriangle.cpp + ogrutils.cpp + ogrgeometry.cpp + ogrgeometrycollection.cpp + ogrmultipolygon.cpp + ogrsurface.cpp + ogrpolyhedralsurface.cpp + ogrtriangulatedsurface.cpp + ogrmultipoint.cpp + ogrmultilinestring.cpp + ogrcircularstring.cpp + ogrcompoundcurve.cpp + ogrcurvepolygon.cpp + ogrcurvecollection.cpp + ogrmulticurve.cpp + ogrmultisurface.cpp + ogr_api.cpp + ogrfeature.cpp + ogrfeaturedefn.cpp + ogrfeaturequery.cpp + ogrfeaturestyle.cpp + ogrfielddefn.cpp + ogrspatialreference.cpp + ogr_srsnode.cpp + ogr_srs_proj4.cpp + ogr_fromepsg.cpp + ogrct.cpp + ogr_opt.cpp + ogr_srs_esri.cpp + ogr_srs_pci.cpp + ogr_srs_usgs.cpp + ogr_srs_dict.cpp + ogr_srs_panorama.cpp + ogr_srs_ozi.cpp + ogr_srs_erm.cpp + swq.cpp + swq_expr_node.cpp + swq_parser.cpp + swq_select.cpp + swq_op_registrar.cpp + swq_op_general.cpp + ogr_srs_validate.cpp + ogr_srs_xml.cpp + ograssemblepolygon.cpp + ogr2gmlgeometry.cpp + gml2ogrgeometry.cpp + ogr_expat.cpp + ogrpgeogeometry.cpp + ogrgeomediageometry.cpp + ogr_geocoding.cpp + osr_cs_wkt.c + osr_cs_wkt_parser.c + ogrgeomfielddefn.cpp + ograpispy.cpp + ogr_xerces.cpp + ) +foreach(fmt ${OGR_FORMATS}) + if(NOT "${fmt}" STREQUAL "generic") + string(TOUPPER "${fmt}" UFMT) + add_definitions(-D${UFMT}_ENABLED) + endif(NOT "${fmt}" STREQUAL "generic") +endforeach(fmt ${OGR_FORMATS}) add_definitions(-DHAVE_MITAB) +add_definitions(-DMITAB_USE_OFTDATETIME) +add_definitions(-DOGR) +add_definitions(-DSAOffset=vsi_l_offset) +add_definitions(-DUSE_CPL) +add_definitions(-D_XOPEN_SOURCE=500) -add_library(gdal_ogr_obj OBJECT ${ogr_srcs}) -set_target_properties(gdal_ogr_obj PROPERTIES FOLDER "Third Party Libraries/GDAL") +add_library(gdal_ogr SHARED ${ogr_srcs} $<TARGET_OBJECTS:json_obj>) +set_target_properties(gdal_ogr PROPERTIES FOLDER "Third Party Libraries/GDAL") +install(TARGETS gdal_ogr + RUNTIME DESTINATION ${BIN_DIR} + LIBRARY DESTINATION ${LIB_DIR} + ARCHIVE DESTINATION ${LIB_DIR}) +# Local Variables: +# tab-width: 8 +# mode: cmake +# indent-tabs-mode: t +# End: +# ex: shiftwidth=2 tabstop=8 Copied: brlcad/trunk/src/other/gdal/ogr/COPYING (from rev 76812, brlcad/trunk/src/other/gdal/ogr/ogrsf_frmts/shape/COPYING) =================================================================== --- brlcad/trunk/src/other/gdal/ogr/COPYING (rev 0) +++ brlcad/trunk/src/other/gdal/ogr/COPYING 2020-08-17 02:56:07 UTC (rev 76813) @@ -0,0 +1,483 @@ + + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for +your libraries, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if +you distribute copies of the library, or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link a program with the library, you must provide +complete object files to the recipients so that they can relink them +with the library, after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal +permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, so that any problems introduced by others will not reflect on +the original authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the ordinary +GNU General Public License, which was designed for utility programs. This +license, the GNU Library General Public License, applies to certain +designated libraries. This license is quite different from the ordinary +one; be sure to read it in full, and don't assume that anything in it is +the same as in the ordinary license. + + The reason we have a separate public license for some libraries is that +they blur the distinction we usually make between modifying or adding to a +program and simply using it. Linking a program with a library, without +changing the library, is in some sense simply using the library, and is +analogous to running a utility program or application program. However, in +a textual and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General Public License +treats it as such. + + Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We +concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended to +permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to achieve +this as regards changes in header files, but we have achieved it as regards +changes in the actual functions of the Library.) The hope is that this +will lead to faster development of free libraries. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, while the latter only +works together with the library. + + Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which +contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Library +General Public License (also called "this License"). Each licensee is +addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also compile or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + c) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the source code distributed need not include anything that is normally +distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Library General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + <one line to give the library's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + <signature of Ty Coon>, 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + Copied: brlcad/trunk/src/other/gdal/ogr/README.txt (from rev 76812, brlcad/trunk/src/other/gdal/ogr/ogrsf_frmts/ntf/README.txt) =================================================================== --- brlcad/trunk/src/other/gdal/ogr/README.txt (rev 0) +++ brlcad/trunk/src/other/gdal/ogr/README.txt 2020-08-17 02:56:07 UTC (rev 76813) @@ -0,0 +1,213 @@ + + NTF OGR Implementation Notes + ============================ + + +Products (and Layers) Supported +------------------------------- + +Landline (and Landline Plus): + LANDLINE_POINT + LANDLINE_LINE + LANDLINE_NAME + +Panorama Contours: + PANORAMA_POINT + PANORAMA_CONTOUR + + HEIGHT attribute holds elevation. + +Strategi: + STRATEGI_POINT + STRATEGI_LINE + STRATEGI_TEXT + STRATEGI_NODE + +Meridian: + MERIDIAN_POINT + MERIDIAN_LINE + MERIDIAN_TEXT + MERIDIAN_NODE + +Boundaryline: + BOUNDARYLINE_LINK + BOUNDARYLINE_POLY + BOUNDARYLINE_COLLECTIONS + + The _POLY layer has links to links allowing true polygons to + be formed (otherwise the _POLY's only have a seed point for geometry. + The collections are collections of polygons (also without geometry + as read). This is the only product from which polygons can be + constructed. + +Boundary Line 2000: + BL2000_LINK + BL2000_POLY + BL2000_COLLECTIONS + + Similar to Boundaryline, but with different attributes, feature code + is largely unused, and the _POLY layer doesn't have a seed point. + +BaseData.GB: + BASEDATA_POINT + BASEDATA_LINE + BASEDATA_TEXT + BASEDATA_NODE + +OSCAR Asset/Traffic: + OSCAR_POINT + OSCAR_LINE + OSCAR_NODE + +OSCAR Network: + OSCAR_NETWORK_POINT + OSCAR_NETWORK_LINE + OSCAR_NETWORK_NODE + +Address Point: + ADDRESS_POINT + +Code Point: + CODE_POINT + +Code Point Plus: + CODE_POINT_PLUS + +The dataset as a whole will also have a FEATURE_CLASSES layer containing a +pure table relating FEAT_CODE numbers with feature class names (FC_NAME). +This applies to all products in the dataset. A few layer types (such as +the Code Point, and Address Point products) don't include feature classes. +Some products use features classes that are not defined in the file, and +so they will not appear in the FEATURE_CLASSES layer. + + +Product Schemas +--------------- + +The approach taken in this reader is to treat one file, or a directory +of files as a single dataset. All files in the dataset are scanned on +open. For each particular product (listed above) a set of layers are +created; however, these layers may be extracted from several files of the +same product. + +The layers are based on a low level feature type in the NTF file, but will +generally contain features of many different feature codes (FEAT_CODE +attribute). Different features within a given layer may have a variety of +attributes in the file; however, the schema is established based on the +union of all attributes possible within features of a particular type +(i.e. POINT) of that product family (i.e. OSCAR Network). + +If an NTF product is read that doesn't match one of the known schema's +it will go through a different generic handler which has only +layers of type GENERIC_POINT and GENERIC_LINE. The features only have +a FEAT_CODE attribute. + +Details of what layers of what products have what attributes can be found +in the NTFFileReader::EstablishLayers() method at the end of ntf_estlayers.cpp. +This file also contains all the product specific translation code. + + +Special Attributes +------------------ + +FEAT_CODE: General feature code integer, can be used to lookup a name in the + FEATURE_CLASSES layer/table. + +TEXT_ID/POINT_ID/LINE_ID/NAME_ID/COLL_ID/POLY_ID/GEOM_ID: + Unique identifier for a feature of the appropriate type. + +TILE_REF: All layers (except FEATURE_CLASSES) contain a TILE_REF attribute + which indicates which tile (file) the features came from. Generally + speaking the id numbers are only unique within the tile and so + the TILE_REF can be used restrict id links within features from + the same file. + +FONT/TEXT_HT/DIG_POSTN/ORIENT: + Detailed information on the font, text height, digitizing position, + and orientation of text or name objects. Review the OS product + manuals to understand the units, and meaning of these codes. + +GEOM_ID_OF_POINT: + For _NODE features this defines the POINT_ID of the point layer object + to which this node corresponds. Generally speaking the nodes don't + carry a geometry of their own. The node must be related to a point + to establish it's position. + +GEOM_ID_OF_LINK: + A _list_ of _LINK or _LINE features to end/start at a node. Nodes, + and this field are generally only of value when establishing + connectivity of line features for network analysis. Note that this + should be related to the target features GEOM_ID, not it's LINE_ID. + + On the BOUNDARYLINE_POLY layer this attribute contains the GEOM_IDs + of the lines which form the edge of the polygon. + +POLY_ID: + A list of POLY_ID's from the BOUNDARYLINE_POLY layer associated with + a given collection in the BOUNDARYLINE_COLLECTIONS layer. + + +Adding a New Product +-------------------- + +It is anticipated that over time the UK Ordnance Survey will define new +product formats, and to get decent mileage out of them this library should +be updated to support them. While I will endeavor to do this myself, it +seems prudent to define how it is done in case I am not available to do it, +or am unwilling to do it on a timely basis. To add a new product type the +following steps are required: + + o Add an NPC_ code for the product in ntf.h + o Add a case in NTFFileReader::Open() to translate the GetProduct() result + into the NPC_ code. + o Add a case in NTFFileReader::EstablishLayers() defining the layers found + on this product. + o Add translate functions for layers of this product. Generally they can + be cloned from an existing translate function, and the attribute mapping + in the NTFReader::ApplyAttributeValues() call can be modified. + +Occasionally existing products will change slightly. This may result in a +slight change to the detection logic in NTFFileReader::Open() and changes +in the list of user attributes associated with the layer. If the differences +are significant it may be necessary to define a whole new product family +type (as is done for Code Point Plus vs. Code Point). + +Generic Products +---------------- + +In situations where a file is not identified as being part of an existing +known product it will be treated generically. In this case the entire dataset +is scanned to establish what features have what attributes. Because of this, +opening a generic dataset can be much slower than opening a recognized dataset. +Based on this scan a list of generic features (layers) are defined from the +following set: + + GENERIC_POINT + GENERIC_LINE + GENERIC_NAME + GENERIC_TEXT + GENERIC_POLY + GENERIC_NODE + GENERIC_COLLECTION + +Generic products are primarily handled by the ntf_generic.cpp module whereas +specific products are handled in ntf_estlayers.cpp. + +Because some data products (OSNI datasets) not from the Ordnance Survey +were found to have record groups in unusual orders compared to what the +UK Ordnance Survey does, it was found necessary to cache all the records of +level 3 and higher generic products, and construct record groups by id +reference from within this cache rather than depending on convenient record +orderings. This is accomplished by the NTFFileReader "indexing" capability +near the bottom of ntffilereader.cpp. Because of this in memory indexing +accessing generic datasets can be much more memory intensive than accessing +known data products, though it isn't necessary for generic level 1 and 2 +products. + +It is possible to force a known product to be treated as generic by setting +the FORCE_GENERIC option to "ON" using OGRNTFDataSource::SetOptionsList() as +is demonstrated in ntfdump.cpp. + + + + Copied: brlcad/trunk/src/other/gdal/ogr/avc.h (from rev 76812, brlcad/trunk/src/other/gdal/ogr/ogrsf_frmts/avc/avc.h) =================================================================== --- brlcad/trunk/src/other/gdal/ogr/avc.h (rev 0) +++ brlcad/trunk/src/other/gdal/ogr/avc.h 2020-08-17 02:56:07 UTC (rev 76813) @@ -0,0 +1,862 @@ +/********************************************************************** + * $Id: avc.h 35933 2016-10-25 16:46:26Z goatbar $ + * + * Name: avc.h + * Project: Arc/Info Vector coverage (AVC) BIN<->E00 conversion library + * Language: ANSI C + * Purpose: Header file containing all definitions for the library. + * Author: Daniel Morissette, dmorisse...@dmsolutions.ca + * + ********************************************************************** + * Copyright (c) 1999-2001, Daniel Morissette + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + ********************************************************************** + * + * $Log: avc.h,v $ + * Revision 1.25 2008/07/23 20:51:38 dmorissette + * Fixed GCC 4.1.x compile warnings related to use of char vs unsigned char + * (GDAL/OGR ticket http://trac.osgeo.org/gdal/ticket/2495) + * + * Revision 1.24 2006/08/17 20:09:45 dmorissette + * Update for 2.0.0 release + * + * Revision 1.23 2006/08/17 18:56:42 dmorissette + * Support for reading standalone info tables (just tables, no coverage + * data) by pointing AVCE00ReadOpen() to the info directory (bug 1549). + * + * Revision 1.22 2006/06/27 18:38:43 dmorissette + * Cleaned up E00 reading (bug 1497, patch from James F.) + * + * Revision 1.21 2006/06/16 11:48:11 daniel + * New functions to read E00 files directly as opposed to translating to + * binary coverage. Used in the implementation of E00 read support in OGR. + * Contributed by James E. Flemer. (bug 1497) + * + * Revision 1.20 2006/06/14 16:31:28 daniel + * Added support for AVCCoverPC2 type (bug 1491) + * + * Revision 1.19 2005/06/03 03:49:58 daniel + * Update email address, website url, and copyright dates + * + * Revision 1.18 2005/06/03 03:29:16 daniel + * Ready for 1.3.0 release + * + * Revision 1.17 2004/02/11 05:49:44 daniel + * Added support for deleted flag in arc.dir (bug 2332) + * + * Revision 1.16 2002/02/14 16:34:15 warmerda + * fixed prototype name for AVCBinReadNextPrj + * + * Revision 1.15 2002/02/13 20:35:24 warmerda + * added AVCBinReadObject + * + * Revision 1.14 2001/11/25 21:15:23 daniel + * Added hack (AVC_MAP_TYPE40_TO_DOUBLE) to map type 40 fields bigger than 8 + * digits to double precision as we generate E00 output (bug599) + * + * Revision 1.13 2001/02/20 15:24:11 daniel + * Updated AVC_VERSION="1.2.0 (2000-10-17)" + * + * Revision 1.12 2000/09/26 21:38:44 daniel + * Updated AVC_VERSION + * + * Revision 1.11 2000/09/26 20:21:04 daniel + * Added AVCCoverPC write + * + * Revision 1.10 2000/09/22 19:45:20 daniel + * Switch to MIT-style license + * + * Revision 1.9 2000/05/29 15:31:30 daniel + * Added Japanese DBCS support + * + * Revision 1.8 2000/01/10 02:56:01 daniel + * Added read support for "weird" coverages + * + * Revision 1.7 1999/12/24 07:18:34 daniel + * Added PC Arc/Info coverages support + * + * Revision 1.6 1999/08/23 18:15:56 daniel + * Added AVCE00DeleteCoverage() + * + * Revision 1.5 1999/06/08 22:07:28 daniel + * Added AVCReadWrite in AVCAccess type + * + * Revision 1.4 1999/05/17 16:16:41 daniel + * Added RXP + TXT/TX6/TX7 write support + * + * Revision 1.3 1999/05/11 02:15:04 daniel + * Added coverage write support + * + * Revision 1.2 1999/02/25 03:39:39 daniel + * Added TXT, TX6/TX7, RXP and RPL support + * + * Revision 1.1 1999/01/29 16:29:24 daniel + * Initial revision + * + **********************************************************************/ + +#ifndef AVC_H_INCLUDED_ +#define AVC_H_INCLUDED_ + +#include "cpl_conv.h" +#include "cpl_string.h" + +#ifdef GDAL_COMPILATION +#include "shapefil.h" +#else +#include "dbfopen.h" +#endif + +#include "avc_mbyte.h" + +CPL_C_START + +/*--------------------------------------------------------------------- + * Current version of the AVCE00 library... always useful! + *--------------------------------------------------------------------*/ +#define AVC_VERSION "2.0.0 (2006-08-17)" + +/* Coverage precision + */ +#define AVC_DEFAULT_PREC 0 +#define AVC_SINGLE_PREC 1 +#define AVC_DOUBLE_PREC 2 + +/* AVC_FORMAT_DBF_FLOAT used as nPrecision value only for AVCPrintRealValue() + */ +#define AVC_FORMAT_DBF_FLOAT 42 + +/* Coverage file types + */ +typedef enum +{ + AVCFileUnknown = 0, + AVCFileARC, + AVCFilePAL, + AVCFileCNT, + AVCFileLAB, + AVCFilePRJ, + AVCFileTOL, + AVCFileLOG, + AVCFileTXT, /* TXT and TX6 share the same binary format */ + AVCFileTX6, + AVCFileRXP, + AVCFileRPL, /* RPL is a PAL for a region */ + AVCFileTABLE +}AVCFileType; + +/* Read or Write access flag + */ +typedef enum +{ + AVCRead, + AVCWrite, + AVCReadWrite +} AVCAccess; + +/* Coverage type: PC Arc/Info or Unix Arc/Info v7 + */ +typedef enum +{ + AVCCoverTypeUnknown = 0, + AVCCoverV7, + AVCCoverPC, + AVCCoverPC2, /* Unknown version... hybrid between V7 and PC !!! */ + AVCCoverWeird, /* Unknown version... hybrid between V7 and PC !!! */ + AVCCoverV7Tables /* Standalone tables, only an info directory */ +} AVCCoverType; + +/* Enum for byte ordering + */ +typedef enum +{ + AVCBigEndian, /* CPL_MSB, Motorola ordering */ + AVCLittleEndian /* CPL_LSB, Intel ordering */ +} AVCByteOrder; + +/* Macros to establish byte ordering for each coverage type + * The rule until now: all coverage types use big endian (Motorola ordering) + * except PC Arc/Info coverages variant 1 (AVCCoverPC). + */ +#define AVC_COVER_BYTE_ORDER(cover_type) \ + (((cover_type) == AVCCoverPC ) ? AVCLittleEndian : AVCBigEndian ) + +/*===================================================================== + Structures + =====================================================================*/ + +/*--------------------------------------------------------------------- + * Structures defining various Arc/Info objects types. + * These are shared by the Binary and the E00 functions. + *--------------------------------------------------------------------*/ + +typedef struct AVCVertex_t +{ + double x; /* Even for single precision, we always */ + double y; /* use doubles for the vertices in memory. */ +}AVCVertex; + +/*--------------------------------------------------------------------- + * AVCArc: Information about an ARC + *--------------------------------------------------------------------*/ +typedef struct AVCArc_t +{ + GInt32 nArcId; + GInt32 nUserId; + GInt32 nFNode; + GInt32 nTNode; + GInt32 nLPoly; + GInt32 nRPoly; + GInt32 numVertices; + AVCVertex *pasVertices; +}AVCArc; + +/*--------------------------------------------------------------------- + * AVCPal: A PAL (Polygon Arc List) references all the arcs that + * constitute a polygon. + *--------------------------------------------------------------------*/ +typedef struct AVCPalArc_t +{ + GInt32 nArcId; + GInt32 nFNode; + GInt32 nAdjPoly; +}AVCPalArc; + +typedef struct AVCPal_t +{ + GInt32 nPolyId; + AVCVertex sMin; + AVCVertex sMax; + GInt32 numArcs; + AVCPalArc *pasArcs; +}AVCPal; + +/*--------------------------------------------------------------------- + * AVCCnt: Information about a CNT (polygon centroid) + *--------------------------------------------------------------------*/ +typedef struct AVCCnt_t +{ + GInt32 nPolyId; + AVCVertex sCoord; + GInt32 numLabels; /* 0 or 1 */ + GInt32 *panLabelIds; +}AVCCnt; + +/*--------------------------------------------------------------------- + * AVCLab: Information about a LAB (polygon Label) + *--------------------------------------------------------------------*/ +typedef struct AVCLab_t +{ + GInt32 nValue; + GInt32 nPolyId; + AVCVertex sCoord1; + AVCVertex sCoord2; + AVCVertex sCoord3; +}AVCLab; + +/*--------------------------------------------------------------------- + * AVCTol: Information about a TOL record (coverage tolerances) + *--------------------------------------------------------------------*/ +typedef struct AVCTol_t +{ + GInt32 nIndex; + GInt32 nFlag; + double dValue; +}AVCTol; + +/*--------------------------------------------------------------------- + * AVCTxt: Information about a TXT/TX6/TX7 record (annotations) + *--------------------------------------------------------------------*/ +typedef struct AVCTxt_t +{ + GInt32 nTxtId; + GInt32 nUserId; + GInt32 nLevel; + float f_1e2; /* Always (float)-1e+20, even for double precision! */ + GInt32 nSymbol; + GInt32 numVerticesLine; + GInt32 n28; /* Unknown value at byte 28 */ + GInt32 numChars; + GInt32 numVerticesArrow; + + GInt16 anJust1[20]; + GInt16 anJust2[20]; + + double dHeight; + double dV2; /* ??? */ + double dV3; /* ??? */ + + GByte *pszText; /* Needs to be unsigned char for DBCS */ + + AVCVertex *pasVertices; +}AVCTxt; + +/*--------------------------------------------------------------------- + * AVCRxp: Information about a RXP record (something related to regions...) + *--------------------------------------------------------------------*/ +typedef struct AVCRxp_t +{ + GInt32 n1; + GInt32 n2; +}AVCRxp; + +/*--------------------------------------------------------------------- + * AVCTableDef: Definition of an INFO table's structure. + * This info is read from several files: + * info/arc.dir + * info/arc####.dat + * info/arc####.nit + * + * And the data for the table itself is stored in a binary + * file in the coverage directory. + *--------------------------------------------------------------------*/ + +typedef struct AVCFieldInfo_t +{ + char szName[17]; + GInt16 nSize; + GInt16 v2; + GInt16 nOffset; + GInt16 v4; + GInt16 v5; + GInt16 nFmtWidth; + GInt16 nFmtPrec; + GInt16 nType1; + GInt16 nType2; + GInt16 v10; + GInt16 v11; + GInt16 v12; + GInt16 v13; + char szAltName[17]; + GInt16 nIndex; /* >0 if valid, or -1 if field is deleted */ +}AVCFieldInfo; + +#define AVC_FT_DATE 10 +#define AVC_FT_CHAR 20 +#define AVC_FT_FIXINT 30 +#define AVC_FT_FIXNUM 40 +#define AVC_FT_BININT 50 +#define AVC_FT_BINFLOAT 60 + +typedef struct AVCTableDef_t +{ + /* Stuff read from the arc.dir file + * (1 record, corresponding to this table, from the arc.dir file) + */ + char szTableName[33]; + char szInfoFile[9]; + GInt16 numFields; + GInt16 nRecSize; + GInt32 numRecords; + char szExternal[3]; /* "XX" or " " */ + GInt16 bDeletedFlag; /* 1 if deleted, 0 if table is active */ + + /* Data file path read from the arc####.dat file + */ + char szDataFile[81]; + + /* Field information read from the arc####.nit file + */ + AVCFieldInfo *pasFieldDef; +} AVCTableDef; + +typedef struct AVCField_t +{ + GInt16 nInt16; + GInt32 nInt32; + float fFloat; + double dDouble; + GByte *pszStr; +} AVCField; + +/*--------------------------------------------------------------------- + * Stuff related to buffered reading of raw binary files + *--------------------------------------------------------------------*/ + +#define AVCRAWBIN_READBUFSIZE 1024 + +typedef struct AVCRawBinFile_t +{ + FILE *fp; + char *pszFname; + AVCAccess eAccess; + AVCByteOrder eByteOrder; + GByte abyBuf[AVCRAWBIN_READBUFSIZE]; + int nOffset; /* Location of current buffer in the file */ + int nCurSize; /* Nbr of bytes currently loaded */ + int nCurPos; /* Next byte to read from abyBuf[] */ + + int nFileDataSize; /* File Size as stated in the header */ + /* EOF=TRUE passed this point in file */ + /* Set to -1 if not specified. */ + + /* Handle on dataset's multibyte character encoding info. */ + AVCDBCSInfo *psDBCSInfo; + +} AVCRawBinFile; + +/*--------------------------------------------------------------------- + * Stuff related to reading and writing binary coverage files + *--------------------------------------------------------------------*/ + +typedef struct AVCBinHeader_t +{ + GUInt32 nSignature; + GInt32 nPrecision; /* <0 for double prec., >0 for single prec. */ + GInt32 nRecordSize; /* nbr of 2 byte words, 0 for var. length */ + GInt32 nLength; /* Overall file length, in 2 byte words */ +}AVCBinHeader; + +typedef struct AVCBinFile_t +{ + AVCRawBinFile *psRawBinFile; + char *pszFilename; + AVCRawBinFile *psIndexFile; /* Index file, Write mode only */ + + DBFHandle hDBFFile; /* Used for AVCCoverPC/PC2 DBF TABLES only */ + int nCurDBFRecord; /* 0-based record index in DBF file */ + + AVCCoverType eCoverType; + AVCFileType eFileType; + int nPrecision; /* AVC_SINGLE/DOUBLE_PREC */ + + union + { + AVCTableDef *psTableDef; + }hdr; + + /* cur.* : temp. storage used to read one record (ARC, PAL, ... or + * Table record) from the file. + */ + union + { + AVCArc *psArc; + AVCPal *psPal; + AVCCnt *psCnt; + AVCLab *psLab; + AVCTol *psTol; + AVCTxt *psTxt; + AVCRxp *psRxp; + AVCField *pasFields; + char **papszPrj; + }cur; + +} AVCBinFile; + +/*--------------------------------------------------------------------- + * Stuff related to the generation of E00 + *--------------------------------------------------------------------*/ + +/*--------------------------------------------------------------------- + * AVCE00GenInfo structure + * This structure is used by the E00 generator functions to store + * their buffer and their current state in case they need to be + * called more than once for a given object type (i.e. ARC, PAL and IFO). + *--------------------------------------------------------------------*/ + +typedef struct AVCE00GenInfo_t +{ + char *pszBuf; + int nBufSize; + + int nPrecision; /* AVC_SINGLE/DOUBLE_PREC */ + int iCurItem; + int numItems; +}AVCE00GenInfo; + +/*--------------------------------------------------------------------- + * Stuff related to the parsing of E00 + *--------------------------------------------------------------------*/ + +/*--------------------------------------------------------------------- + * AVCE00ParseInfo structure + * This structure is used by the E00 parser functions to store + * their buffer and their current state while parsing an object. + *--------------------------------------------------------------------*/ + +typedef struct AVCE00ParseInfo_t +{ + AVCFileType eFileType; + int nPrecision; /* AVC_SINGLE/DOUBLE_PREC */ + int iCurItem; + int numItems; + int nStartLineNum; + int nCurLineNum; + + int nCurObjectId; + GBool bForceEndOfSection; /* For sections that don't have an */ + /* explicit end-of-section line. */ + AVCFileType eSuperSectionType;/* For sections containing several files*/ + char *pszSectionHdrLine; /* Used by supersection types */ + + union + { + AVCTableDef *psTableDef; + }hdr; + GBool bTableHdrComplete; /* FALSE until table header is */ + /* finished parsing */ + int nTableE00RecLength; + + /* cur.* : temp. storage used to store current object (ARC, PAL, ... or + * Table record) from the file. + */ + union + { + AVCArc *psArc; + AVCPal *psPal; + AVCCnt *psCnt; + AVCLab *psLab; + AVCTol *psTol; + AVCTxt *psTxt; + AVCRxp *psRxp; + AVCField *pasFields; + char **papszPrj; + }cur; + + char *pszBuf; /* Buffer used only for TABLEs */ + int nBufSize; +}AVCE00ParseInfo; + +/*--------------------------------------------------------------------- + * Stuff related to the transparent binary -> E00 conversion + *--------------------------------------------------------------------*/ +typedef struct AVCE00Section_t +{ + AVCFileType eType; /* File Type */ + char *pszName; /* E00 section or Table Name */ + char *pszFilename; /* Binary/E00 file filename */ + int nLineNum; /* E00 line number */ + int nFeatureCount; +}AVCE00Section; + +typedef struct AVCE00ReadInfo_t +{ + char *pszCoverPath; + char *pszInfoPath; + char *pszCoverName; + AVCCoverType eCoverType; + + /* pasSections is built when the coverage is opened and describes + * the skeleton of the E00 file. + */ + AVCE00Section *pasSections; + int numSections; + + /* If bReadAllSections=TRUE then reading automatically continues to + * the next section when a section finishes. (This is the default) + * Otherwise, you can use AVCE00ReadGotoSection() to read one section + * at a time... this will set bReadAllSections=FALSE. + */ + GBool bReadAllSections; + + /* Info about the file (or E00 section) currently being processed + */ + int iCurSection; + AVCBinFile *hFile; + + int iCurStep; /* AVC_GEN_* values, see below */ + AVCE00GenInfo *hGenInfo; + + /* Info related to multibyte character encoding + */ + AVCDBCSInfo *psDBCSInfo; + +} *AVCE00ReadPtr; + +typedef struct AVCE00ReadInfoE00_t +{ + char *pszCoverPath; + char *pszCoverName; + + AVCE00ParseInfo *hParseInfo; + AVCFileType eCurFileType; + + /* pasSections is built when the coverage is opened and describes + * the sections in the E00 file. + */ + AVCE00Section *pasSections; + int numSections; + + /* If bReadAllSections=TRUE then reading automatically continues to + * the next section when a section finishes. (This is the default) + * Otherwise, you can use AVCE00ReadGotoSectionE00() to read one + * section at a time. + */ + GBool bReadAllSections; + + /* File handle of the E00 file currently being processed + */ + FILE *hFile; + +} *AVCE00ReadE00Ptr; + +/* E00 generation steps... tells the AVCE00Read*() functions which + * parts of the given E00 file are currently being processed. + */ +#define AVC_GEN_NOTSTARTED 0 +#define AVC_GEN_DATA 1 +#define AVC_GEN_ENDSECTION 2 +#define AVC_GEN_TABLEHEADER 3 +#define AVC_GEN_TABLEDATA 4 + +/*--------------------------------------------------------------------- + * Stuff related to the transparent E00 -> binary conversion + *--------------------------------------------------------------------*/ +typedef struct AVCE00WriteInfo_t +{ + char *pszCoverPath; + char *pszInfoPath; + char *pszCoverName; + AVCCoverType eCoverType; + + /* Info about the file (or E00 section) currently being processed + */ + AVCFileType eCurFileType; + AVCBinFile *hFile; + + /* Requested precision for the new coverage... may differ from the + * precision of the E00 input lines. (AVC_SINGLE_PREC or AVC_DOUBLE_PREC) + */ + int nPrecision; + + AVCE00ParseInfo *hParseInfo; + + /* Info related to multibyte character encoding + */ + AVCDBCSInfo *psDBCSInfo; + +} *AVCE00WritePtr; + +/* Coverage generation steps... used to store the current state of the + * AVCE00WriteNextLine() function. + */ +#define AVC_WR_TOPLEVEL 0 +#define AVC_WR_READING_SECTION + +/*===================================================================== + Function prototypes (lower-level lib. functions) + =====================================================================*/ + +/*--------------------------------------------------------------------- + * Functions related to buffered reading of raw binary files (and writing) + *--------------------------------------------------------------------*/ +AVCRawBinFile *AVCRawBinOpen(const char *pszFname, const char *pszAccess, + AVCByteOrder eFileByteOrder, + AVCDBCSInfo *psDBCSInfo); +void AVCRawBinClose(AVCRawBinFile *psInfo); +void AVCRawBinFSeek(AVCRawBinFile *psInfo, int nOffset, int nFrom); +GBool AVCRawBinEOF(AVCRawBinFile *psInfo); +void AVCRawBinSetFileDataSize(AVCRawBinFile *psInfo, int nDataSize); + +void AVCRawBinReadBytes(AVCRawBinFile *psInfo, int nBytesToRead, + GByte *pBuf); +GInt16 AVCRawBinReadInt16(AVCRawBinFile *psInfo); +GInt32 AVCRawBinReadInt32(AVCRawBinFile *psInfo); +float AVCRawBinReadFloat(AVCRawBinFile *psInfo); +double AVCRawBinReadDouble(AVCRawBinFile *psInfo); +void AVCRawBinReadString(AVCRawBinFile *psFile, int nBytesToRead, + GByte *pBuf); + +void AVCRawBinWriteBytes(AVCRawBinFile *psFile, int nBytesToWrite, + const GByte *pBuf); +void AVCRawBinWriteInt16(AVCRawBinFile *psFile, GInt16 n16Value); +void AVCRawBinWriteInt32(AVCRawBinFile *psFile, GInt32 n32Value); +void AVCRawBinWriteFloat(AVCRawBinFile *psFile, float fValue); +void AVCRawBinWriteDouble(AVCRawBinFile *psFile, double dValue); +void AVCRawBinWriteZeros(AVCRawBinFile *psFile, int nBytesToWrite); +void AVCRawBinWritePaddedString(AVCRawBinFile *psFile, int nFieldSize, + const GByte *pszString); + +/*--------------------------------------------------------------------- + * Functions related to reading the binary coverage files + *--------------------------------------------------------------------*/ + +AVCBinFile *AVCBinReadOpen(const char *pszPath, const char *pszName, + AVCCoverType eCoverType, AVCFileType eType, + AVCDBCSInfo *psDBCSInfo); +void AVCBinReadClose(AVCBinFile *psFile); + +int AVCBinReadRewind(AVCBinFile *psFile); + +void *AVCBinReadObject(AVCBinFile *psFile, int iObjIndex ); +void *AVCBinReadNextObject(AVCBinFile *psFile); +AVCArc *AVCBinReadNextArc(AVCBinFile *psFile); +AVCPal *AVCBinReadNextPal(AVCBinFile *psFile); +AVCCnt *AVCBinReadNextCnt(AVCBinFile *psFile); +AVCLab *AVCBinReadNextLab(AVCBinFile *psFile); +AVCTol *AVCBinReadNextTol(AVCBinFile *psFile); +AVCTxt *AVCBinReadNextTxt(AVCBinFile *psFile); +AVCRxp *AVCBinReadNextRxp(AVCBinFile *psFile); +AVCField *AVCBinReadNextTableRec(AVCBinFile *psFile); +char **AVCBinReadNextPrj(AVCBinFile *psFile); + +char **AVCBinReadListTables(const char *pszInfoPath, + const char *pszCoverName, + char ***ppapszArcDatFiles, + AVCCoverType eCoverType, + AVCDBCSInfo *psDBCSInfo); + +/*--------------------------------------------------------------------- + * Functions related to writing the binary coverage files + *--------------------------------------------------------------------*/ +AVCBinFile *AVCBinWriteCreate(const char *pszPath, const char *pszName, + AVCCoverType eCoverType, + AVCFileType eType, int nPrecision, + AVCDBCSInfo *psDBCSInfo); +AVCBinFile *AVCBinWriteCreateTable(const char *pszInfoPath, + const char *pszCoverName, + AVCTableDef *psSrcTableDef, + AVCCoverType eCoverType, + int nPrecision, AVCDBCSInfo *psDBCSInfo); +void AVCBinWriteClose(AVCBinFile *psFile); + +int AVCBinWriteHeader(AVCBinFile *psFile); +int AVCBinWriteObject(AVCBinFile *psFile, void *psObj); +int AVCBinWriteArc(AVCBinFile *psFile, AVCArc *psArc); +int AVCBinWritePal(AVCBinFile *psFile, AVCPal *psPal); +int AVCBinWriteCnt(AVCBinFile *psFile, AVCCnt *psCnt); +int AVCBinWriteLab(AVCBinFile *psFile, AVCLab *psLab); +int AVCBinWriteTol(AVCBinFile *psFile, AVCTol *psTol); +int AVCBinWritePrj(AVCBinFile *psFile, char **papszPrj); +int AVCBinWriteTxt(AVCBinFile *psFile, AVCTxt *psTxt); +int AVCBinWriteRxp(AVCBinFile *psFile, AVCRxp *psRxp); +int AVCBinWriteTableRec(AVCBinFile *psFile, AVCField *pasFields); + +/*--------------------------------------------------------------------- + * Functions related to the generation of E00 + *--------------------------------------------------------------------*/ +AVCE00GenInfo *AVCE00GenInfoAlloc(int nCoverPrecision); +void AVCE00GenInfoFree(AVCE00GenInfo *psInfo); +void AVCE00GenReset(AVCE00GenInfo *psInfo); + +const char *AVCE00GenStartSection(AVCE00GenInfo *psInfo, AVCFileType eType, + const char *pszFilename); +const char *AVCE00GenEndSection(AVCE00GenInfo *psInfo, AVCFileType eType, + GBool bCont); + +const char *AVCE00GenObject(AVCE00GenInfo *psInfo, + AVCFileType eType, void *psObj, GBool bCont); +const char *AVCE00GenArc(AVCE00GenInfo *psInfo, AVCArc *psArc, GBool bCont); +const char *AVCE00GenPal(AVCE00GenInfo *psInfo, AVCPal *psPal, GBool bCont); +const char *AVCE00GenCnt(AVCE00GenInfo *psInfo, AVCCnt *psCnt, GBool bCont); +const char *AVCE00GenLab(AVCE00GenInfo *psInfo, AVCLab *psLab, GBool bCont); +const char *AVCE00GenTol(AVCE00GenInfo *psInfo, AVCTol *psTol, GBool bCont); +const char *AVCE00GenTxt(AVCE00GenInfo *psInfo, AVCTxt *psTxt, GBool bCont); +const char *AVCE00GenTx6(AVCE00GenInfo *psInfo, AVCTxt *psTxt, GBool bCont); +const char *AVCE00GenPrj(AVCE00GenInfo *psInfo, char **papszPrj, GBool bCont); +const char *AVCE00GenRxp(AVCE00GenInfo *psInfo, AVCRxp *psRxp, GBool bCont); + +const char *AVCE00GenTableHdr(AVCE00GenInfo *psInfo, AVCTableDef *psDef, + GBool bCont); +const char *AVCE00GenTableRec(AVCE00GenInfo *psInfo, int numFields, + AVCFieldInfo *pasDef, AVCField *pasFields, + GBool bCont); + +/*--------------------------------------------------------------------- + * Functions related to parsing E00 lines + *--------------------------------------------------------------------*/ +AVCE00ParseInfo *AVCE00ParseInfoAlloc(void); +void AVCE00ParseInfoFree(AVCE00ParseInfo *psInfo); +void AVCE00ParseReset(AVCE00ParseInfo *psInfo); + +AVCFileType AVCE00ParseSectionHeader(AVCE00ParseInfo *psInfo, + const char *pszLine); +GBool AVCE00ParseSectionEnd(AVCE00ParseInfo *psInfo, const char *pszLine, + GBool bResetParseInfo); +AVCFileType AVCE00ParseSuperSectionHeader(AVCE00ParseInfo *psInfo, + const char *pszLine); +GBool AVCE00ParseSuperSectionEnd(AVCE00ParseInfo *psInfo, + const char *pszLine ); + +void *AVCE00ParseNextLine(AVCE00ParseInfo *psInfo, const char *pszLine); +AVCArc *AVCE00ParseNextArcLine(AVCE00ParseInfo *psInfo, const char *pszLine); +AVCPal *AVCE00ParseNextPalLine(AVCE00ParseInfo *psInfo, const char *pszLine); +AVCCnt *AVCE00ParseNextCntLine(AVCE00ParseInfo *psInfo, const char *pszLine); +AVCLab *AVCE00ParseNextLabLine(AVCE00ParseInfo *psInfo, const char *pszLine); +AVCTol *AVCE00ParseNextTolLine(AVCE00ParseInfo *psInfo, const char *pszLine); +AVCTxt *AVCE00ParseNextTxtLine(AVCE00ParseInfo *psInfo, const char *pszLine); +AVCTxt *AVCE00ParseNextTx6Line(AVCE00ParseInfo *psInfo, const char *pszLine); +char **AVCE00ParseNextPrjLine(AVCE00ParseInfo *psInfo, const char *pszLine); +AVCRxp *AVCE00ParseNextRxpLine(AVCE00ParseInfo *psInfo, const char *pszLine); +AVCTableDef *AVCE00ParseNextTableDefLine(AVCE00ParseInfo *psInfo, + const char *pszLine); +AVCField *AVCE00ParseNextTableRecLine(AVCE00ParseInfo *psInfo, + const char *pszLine); + +/*--------------------------------------------------------------------- + * Misc. functions shared by several parts of the lib. + *--------------------------------------------------------------------*/ +int _AVCE00ComputeRecSize(int numFields, AVCFieldInfo *pasDef, + GBool bMapType40ToDouble); + +void _AVCDestroyTableFields(AVCTableDef *psTableDef, AVCField *pasFields); +void _AVCDestroyTableDef(AVCTableDef *psTableDef); +AVCTableDef *_AVCDupTableDef(AVCTableDef *psSrcDef); + +GBool AVCFileExists(const char *pszPath, const char *pszName); +char *AVCAdjustCaseSensitiveFilename(char *pszFname); +int AVCPrintRealValue(char *pszBuf, size_t nBufLen, int nPrecision, AVCFileType eType, + double dValue); + +/*===================================================================== + Function prototypes (THE PUBLIC ONES) + =====================================================================*/ + +/*--------------------------------------------------------------------- + * Functions to read E00 + *--------------------------------------------------------------------*/ +AVCE00ReadE00Ptr AVCE00ReadOpenE00(const char *pszE00FileName); +void AVCE00ReadCloseE00(AVCE00ReadE00Ptr psRead); +int AVCE00ReadRewindE00(AVCE00ReadE00Ptr psRead); +void *AVCE00ReadNextObjectE00(AVCE00ReadE00Ptr psRead); + +AVCE00Section *AVCE00ReadSectionsListE00(AVCE00ReadE00Ptr psRead, int *numSect); +int AVCE00ReadGotoSectionE00(AVCE00ReadE00Ptr psRead, + AVCE00Section *psSect, + GBool bContinue); + +/*--------------------------------------------------------------------- + * Functions to make a binary coverage appear as E00 + *--------------------------------------------------------------------*/ + +AVCE00ReadPtr AVCE00ReadOpen(const char *pszCoverPath); +void AVCE00ReadClose(AVCE00ReadPtr psInfo); +const char *AVCE00ReadNextLine(AVCE00ReadPtr psInfo); +int AVCE00ReadRewind(AVCE00ReadPtr psInfo); + +AVCE00Section *AVCE00ReadSectionsList(AVCE00ReadPtr psInfo, int *numSect); +int AVCE00ReadGotoSection(AVCE00ReadPtr psInfo, + AVCE00Section *psSect, + GBool bContinue); + +/*--------------------------------------------------------------------- + * Functions to write E00 lines to a binary coverage + *--------------------------------------------------------------------*/ + +AVCE00WritePtr AVCE00WriteOpen(const char *pszCoverPath, + AVCCoverType eNewCoverType, int nPrecision); +void AVCE00WriteClose(AVCE00WritePtr psInfo); +int AVCE00WriteNextLine(AVCE00WritePtr psInfo, + const char *pszLine); +int AVCE00DeleteCoverage(const char *pszCoverPath); + +CPL_C_END + +#endif /* AVC_H_INCLUDED_ */ Copied: brlcad/trunk/src/other/gdal/ogr/avc_bin.c (from rev 76812, brlcad/trunk/src/other/gdal/ogr/ogrsf_frmts/avc/avc_bin.c) =================================================================== --- brlcad/trunk/src/other/gdal/ogr/avc_bin.c (rev 0) +++ brlcad/trunk/src/other/gdal/ogr/avc_bin.c 2020-08-17 02:56:07 UTC (rev 76813) @@ -0,0 +1,2658 @@ +/********************************************************************** + * $Id: avc_bin.c 36457 2016-11-23 00:18:37Z rouault $ + * + * Name: avc_bin.c + * Project: Arc/Info vector coverage (AVC) BIN->E00 conversion library + * Language: ANSI C + * Purpose: Binary files access functions. + * Author: Daniel Morissette, dmorisse...@dmsolutions.ca + * + ********************************************************************** + * Copyright (c) 1999-2005, Daniel Morissette + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + ********************************************************************** + * + * $Log: avc_bin.c,v $ + * Revision 1.30 2008/07/23 20:51:38 dmorissette + * Fixed GCC 4.1.x compile warnings related to use of char vs unsigned char + * (GDAL/OGR ticket http://trac.osgeo.org/gdal/ticket/2495) + * + * Revision 1.29 2006/08/17 18:56:42 dmorissette + * Support for reading standalone info tables (just tables, no coverage + * data) by pointing AVCE00ReadOpen() to the info directory (bug 1549). + * + * Revision 1.28 2006/06/14 16:31:28 daniel + * Added support for AVCCoverPC2 type (bug 1491) + * + * Revision 1.27 2005/06/03 03:49:58 daniel + * Update email address, website url, and copyright dates + * + * Revision 1.26 2004/02/28 06:35:49 warmerda + * Fixed AVCBinReadObject() index support to use 'x' or 'X' for index + * depending on the case of the original name. + * Fixed so that PC Arc/Info coverages with the extra 256 byte header work + * properly when using indexes to read them. + * http://bugzilla.remotesensing.org/show_bug.cgi?id=493 + * + * Revision 1.25 2004/02/11 05:49:44 daniel + * Added support for deleted flag in arc.dir (bug 2332) + * + * Revision 1.24 2002/08/27 15:26:06 daniel + * Removed C++ style comments for IRIX compiler (GDAL bug 192) + * + * Revision 1.23 2002/04/16 20:04:24 daniel + * Use record size while reading ARC, PAL, CNT to skip junk bytes. (bug940) + * + * Revision 1.22 2002/03/18 19:03:37 daniel + * Fixed AVCBinReadObject() for PAL objects (bug 848) + * + * Revision 1.21 2002/02/14 22:54:13 warmerda + * added polygon and table support for random reading + * + * Revision 1.20 2002/02/13 20:35:24 warmerda + * added AVCBinReadObject + * + * Revision 1.19 2001/11/25 22:01:23 daniel + * Fixed order of args to AVCRawBinFSeek() in _AVCBinReadNextTableRec() + * + * Revision 1.18 2000/10/16 16:16:20 daniel + * Accept TXT files in AVCCoverWeird that use both PC or V7 TXT structure + * + * Revision 1.17 2000/09/26 20:21:04 daniel + * Added AVCCoverPC write + * + * Revision 1.16 2000/09/22 19:45:20 daniel + * Switch to MIT-style license + * + * Revision 1.15 2000/09/20 15:09:34 daniel + * Check for DAT/NIT fnames sometimes truncated to 8 chars in weird coverages + * + * Revision 1.14 2000/06/05 21:38:53 daniel + * Handle precision field > 1000 in cover file header as meaning double prec. + * + * Revision 1.13 2000/05/29 15:31:30 daniel + * Added Japanese DBCS support + * + * Revision 1.12 2000/02/14 17:22:36 daniel + * Check file signature (9993 or 9994) when reading header. + * + * Revision 1.11 2000/02/02 04:24:52 daniel + * Support double precision "weird" coverages + * + * Revision 1.10 2000/01/10 02:54:10 daniel + * Added read support for "weird" coverages + * + * Revision 1.9 2000/01/07 07:11:51 daniel + * Added support for reading PC Coverage TXT files + * + * Revision 1.8 1999/12/24 07:38:10 daniel + * Added missing DBFClose() + * + * Revision 1.7 1999/12/24 07:18:34 daniel + * Added PC Arc/Info coverages support + * + * Revision 1.6 1999/08/23 18:17:16 daniel + * Modified AVCBinReadListTables() to return INFO fnames for DeleteCoverage() + * + * Revision 1.5 1999/05/11 01:49:08 daniel + * Simple changes required by addition of coverage write support + * + * Revision 1.4 1999/03/03 18:42:53 daniel + * Fixed problem with INFO table headers (arc.dir) that sometimes contain an + * invalid number of records. + * + * Revision 1.3 1999/02/25 17:01:53 daniel + * Added support for 16 bit integers in INFO tables (type=50, size=2) + * + * Revision 1.2 1999/02/25 03:41:28 daniel + * Added TXT, TX6/TX7, RXP and RPL support + * + * Revision 1.1 1999/01/29 16:28:52 daniel + * Initial revision + * + **********************************************************************/ + +#include "avc.h" + +#include <ctype.h> /* for isspace() */ + + +/* Used by avc_binwr.c */ +extern int _AVCBinReadNextArcDir(AVCRawBinFile *psFile, AVCTableDef *psArcDir); + +/*===================================================================== + * Prototypes for some static functions + *====================================================================*/ + +static AVCBinFile *_AVCBinReadOpenTable(const char *pszInfoPath, + const char *pszTableName, + AVCCoverType eCoverType, + AVCDBCSInfo *psDBCSInfo); +static AVCBinFile *_AVCBinReadOpenDBFTable(const char *pszInfoPath, + const char *pszTableName); +static AVCBinFile *_AVCBinReadOpenPrj(const char *pszPath,const char *pszName); + +static int _AVCBinReadNextTableRec(AVCRawBinFile *psFile, int nFields, + AVCFieldInfo *pasDef, AVCField *pasFields, + int nRecordSize); +static int _AVCBinReadNextDBFTableRec(DBFHandle hDBFFile, int *piRecordIndex, + int nFields, AVCFieldInfo *pasDef, + AVCField *pasFields); + +/*===================================================================== + * Stuff related to reading the binary coverage files + *====================================================================*/ + +/********************************************************************** + * AVCBinReadOpen() + * + * Open a coverage file for reading, read the file header if applicable, + * and initialize a temp. storage structure to be ready to read objects + * from the file. + * + * pszPath is the coverage (or info directory) path, terminated by + * a '/' or a '\\' + * pszName is the name of the file to open relative to this directory. + * + * Note: For most file types except tables, passing pszPath="" and + * including the coverage path as part of pszName instead would work. + * + * Returns a valid AVCBinFile handle, or NULL if the file could + * not be opened. + * + * AVCBinClose() will eventually have to be called to release the + * resources used by the AVCBinFile structure. + **********************************************************************/ +AVCBinFile *AVCBinReadOpen(const char *pszPath, const char *pszName, + AVCCoverType eCoverType, AVCFileType eFileType, + AVCDBCSInfo *psDBCSInfo) +{ + AVCBinFile *psFile; + + /*----------------------------------------------------------------- + * The case of INFO tables is a bit more complicated... + * pass the control to a separate function. + *----------------------------------------------------------------*/ + if (eFileType == AVCFileTABLE) + { + if (eCoverType == AVCCoverPC || eCoverType == AVCCoverPC2) + return _AVCBinReadOpenDBFTable(pszPath, pszName); + else + return _AVCBinReadOpenTable(pszPath, pszName, + eCoverType, psDBCSInfo); + } + + /*----------------------------------------------------------------- + * PRJ files are text files... we won't use the AVCRawBin*() + * functions for them... + *----------------------------------------------------------------*/ + if (eFileType == AVCFilePRJ) + { + return _AVCBinReadOpenPrj(pszPath, pszName); + } + + /*----------------------------------------------------------------- + * All other file types share a very similar opening method. + *----------------------------------------------------------------*/ + psFile = (AVCBinFile*)CPLCalloc(1, sizeof(AVCBinFile)); + + psFile->eFileType = eFileType; + psFile->eCoverType = eCoverType; + + psFile->pszFilename = (char*)CPLMalloc(strlen(pszPath)+strlen(pszName)+1); + snprintf(psFile->pszFilename, + strlen(pszPath)+strlen(pszName)+1, "%s%s", pszPath, pszName); + + AVCAdjustCaseSensitiveFilename(psFile->pszFilename); + + psFile->psRawBinFile = AVCRawBinOpen(psFile->pszFilename, "r", + AVC_COVER_BYTE_ORDER(eCoverType), + psDBCSInfo); + + if (psFile->psRawBinFile == NULL) + { + /* Failed to open file... just return NULL since an error message + * has already been issued by AVCRawBinOpen() + */ + CPLFree(psFile->pszFilename); + CPLFree(psFile); + return NULL; + } + + /*----------------------------------------------------------------- + * Read the header, and set the precision field if applicable + *----------------------------------------------------------------*/ + if (AVCBinReadRewind(psFile) != 0) + { + CPLFree(psFile->pszFilename); + CPLFree(psFile); + return NULL; + } + + /*----------------------------------------------------------------- + * Allocate a temp. structure to use to read objects from the file + * (Using Calloc() will automatically initialize the struct contents + * to NULL... this is very important for ARCs and PALs) + *----------------------------------------------------------------*/ + if (psFile->eFileType == AVCFileARC) + { + psFile->cur.psArc = (AVCArc*)CPLCalloc(1, sizeof(AVCArc)); + } + else if (psFile->eFileType == AVCFilePAL || + psFile->eFileType == AVCFileRPL ) + { + psFile->cur.psPal = (AVCPal*)CPLCalloc(1, sizeof(AVCPal)); + } + else if (psFile->eFileType == AVCFileCNT) + { + psFile->cur.psCnt = (AVCCnt*)CPLCalloc(1, sizeof(AVCCnt)); + } + else if (psFile->eFileType == AVCFileLAB) + { + psFile->cur.psLab = (AVCLab*)CPLCalloc(1, sizeof(AVCLab)); + } + else if (psFile->eFileType == AVCFileTOL) + { + psFile->cur.psTol = (AVCTol*)CPLCalloc(1, sizeof(AVCTol)); + } + else if (psFile->eFileType == AVCFileTXT || + psFile->eFileType == AVCFileTX6) + { + psFile->cur.psTxt = (AVCTxt*)CPLCalloc(1, sizeof(AVCTxt)); + } + else if (psFile->eFileType == AVCFileRXP) + { + psFile->cur.psRxp = (AVCRxp*)CPLCalloc(1, sizeof(AVCRxp)); + } + else + { + CPLError(CE_Failure, CPLE_IllegalArg, + "%s: Unsupported file type or corrupted file.", + psFile->pszFilename); + CPLFree(psFile->pszFilename); + CPLFree(psFile); + psFile = NULL; + } + + return psFile; +} + +/********************************************************************** + * AVCBinReadClose() + * + * Close a coverage file, and release all memory (object strcut., buffers, + * etc.) associated with this file. + **********************************************************************/ +void AVCBinReadClose(AVCBinFile *psFile) +{ + AVCRawBinClose(psFile->psRawBinFile); + psFile->psRawBinFile = NULL; + + CPLFree(psFile->pszFilename); + psFile->pszFilename = NULL; + + if (psFile->hDBFFile) + DBFClose(psFile->hDBFFile); + + if( psFile->psIndexFile != NULL ) + AVCRawBinClose( psFile->psIndexFile ); + + if (psFile->eFileType == AVCFileARC) + { + if (psFile->cur.psArc) + CPLFree(psFile->cur.psArc->pasVertices); + CPLFree(psFile->cur.psArc); + } + else if (psFile->eFileType == AVCFilePAL || + psFile->eFileType == AVCFileRPL ) + { + if (psFile->cur.psPal) + CPLFree(psFile->cur.psPal->pasArcs); + CPLFree(psFile->cur.psPal); + } + else if (psFile->eFileType == AVCFileCNT) + { + if (psFile->cur.psCnt) + CPLFree(psFile->cur.psCnt->panLabelIds); + CPLFree(psFile->cur.psCnt); + } + else if (psFile->eFileType == AVCFileLAB) + { + CPLFree(psFile->cur.psLab); + } + else if (psFile->eFileType == AVCFileTOL) + { + CPLFree(psFile->cur.psTol); + } + else if (psFile->eFileType == AVCFilePRJ) + { + CSLDestroy(psFile->cur.papszPrj); + } + else if (psFile->eFileType == AVCFileTXT || + psFile->eFileType == AVCFileTX6) + { + if (psFile->cur.psTxt) + { + CPLFree(psFile->cur.psTxt->pasVertices); + CPLFree(psFile->cur.psTxt->pszText); + } + CPLFree(psFile->cur.psTxt); + } + else if (psFile->eFileType == AVCFileRXP) + { + CPLFree(psFile->cur.psRxp); + } + else if (psFile->eFileType == AVCFileTABLE) + { + _AVCDestroyTableFields(psFile->hdr.psTableDef, psFile->cur.pasFields); + _AVCDestroyTableDef(psFile->hdr.psTableDef); + } + else + { + CPLError(CE_Failure, CPLE_IllegalArg, + "Unsupported file type or invalid file handle!"); + } + + CPLFree(psFile); +} + +/********************************************************************** + * _AVCBinReadHeader() + * + * (This function is for internal library use... external calls should + * go to AVCBinReadRewind() instead) + * + * Read the first 100 bytes header of the file and fill the AVCHeader + * structure. + * + * Returns 0 on success or -1 on error. + **********************************************************************/ +static +int _AVCBinReadHeader(AVCRawBinFile *psFile, AVCBinHeader *psHeader, + AVCCoverType eCoverType) +{ + int nStatus = 0; + + /*----------------------------------------------------------------- + * For AVCCoverPC coverages (files without hte .adf extension), + * there is a first 256 bytes header that we just skip and that + * precedes the 100 bytes header block. + * + * In AVCCoverV7, we only have the 100 bytes header. + *----------------------------------------------------------------*/ + if (eCoverType == AVCCoverPC) + AVCRawBinFSeek(psFile, 256, SEEK_SET); + else + AVCRawBinFSeek(psFile, 0, SEEK_SET); + + psHeader->nSignature = AVCRawBinReadInt32(psFile); + + if (AVCRawBinEOF(psFile)) + nStatus = -1; + + psHeader->nPrecision = AVCRawBinReadInt32(psFile); + psHeader->nRecordSize= AVCRawBinReadInt32(psFile); + + /* Jump to 24th byte in header */ + AVCRawBinFSeek(psFile, 12, SEEK_CUR); + psHeader->nLength = AVCRawBinReadInt32(psFile); + + /*----------------------------------------------------------------- + * File length, in words (16 bits)... pass the info to the RawBinFile + * to prevent it from trying to read junk bytes at the end of files... + * this problem happens specially with PC Arc/Info files. + *----------------------------------------------------------------*/ + if (eCoverType == AVCCoverPC) + AVCRawBinSetFileDataSize(psFile, psHeader->nLength*2 + 256); + else + AVCRawBinSetFileDataSize(psFile, psHeader->nLength*2 ); + + /* Move the pointer at the end of the 100 bytes header + */ + AVCRawBinFSeek(psFile, 72, SEEK_CUR); + + return nStatus; +} + + +/********************************************************************** + * AVCBinReadRewind() + * + * Rewind the read pointer, and read/skip the header if necessary so + * that we are ready to read the data objects from the file after + * this call. + * + * Returns 0 on success, -1 on error, and -2 if file has an invalid + * signature and is possibly corrupted. + **********************************************************************/ +int AVCBinReadRewind(AVCBinFile *psFile) +{ + AVCBinHeader sHeader; + int nStatus=0; + + /*----------------------------------------------------------------- + * For AVCCoverPC coverages, there is a first 256 bytes header + * that we just skip and that precedes the 100 bytes header block. + * + * In AVCCoverV7, AVCCoverPC2 and AVCCoverWeird, we only find the + * 100 bytes header. + * + * Note: it is the call to _AVCBinReadHeader() that takes care + * of skipping the first 256 bytes header if necessary. + *----------------------------------------------------------------*/ + + AVCRawBinFSeek(psFile->psRawBinFile, 0, SEEK_SET); + + if ( psFile->eFileType == AVCFileARC || + psFile->eFileType == AVCFilePAL || + psFile->eFileType == AVCFileRPL || + psFile->eFileType == AVCFileCNT || + psFile->eFileType == AVCFileLAB || + psFile->eFileType == AVCFileTXT || + psFile->eFileType == AVCFileTX6 ) + { + nStatus = _AVCBinReadHeader(psFile->psRawBinFile, &sHeader, + psFile->eCoverType); + + /* Store the precision information inside the file handle. + * + * Of course, there had to be an exception... + * At least PAL and TXT files in PC Arc/Info coverages sometimes + * have a negative precision flag even if they contain single + * precision data... why is that???? A PC Arc bug? + * + * 2000-06-05: Found a double-precision PAL file with a signature + * of 1011 (should have been -11). So we'll assume + * that signature > 1000 also means double precision. + */ + if ((sHeader.nPrecision < 0 || sHeader.nPrecision > 1000) && + psFile->eCoverType != AVCCoverPC) + psFile->nPrecision = AVC_DOUBLE_PREC; + else + psFile->nPrecision = AVC_SINGLE_PREC; + + /* Validate the signature value... this will allow us to detect + * corrupted files or files that do not belong in the coverage. + */ + if (sHeader.nSignature != 9993 && sHeader.nSignature != 9994) + { + CPLError(CE_Warning, CPLE_AssertionFailed, + "%s appears to have an invalid file header.", + psFile->pszFilename); + return -2; + } + + /* In Weird coverages, TXT files can be stored in the PC or the V7 + * format. Look at the 'precision' field in the header to tell which + * type we have. + * Weird TXT in PC format: nPrecision = 16 + * Weird TXT in V7 format: nPrecision = +/-67 + * Use AVCFileTXT for PC type, and AVCFileTX6 for V7 type. + */ + if (psFile->eCoverType == AVCCoverWeird && + psFile->eFileType == AVCFileTXT && ABS(sHeader.nPrecision) == 67) + { + /* TXT file will be processed as V7 TXT/TX6/TX7 */ + psFile->eFileType = AVCFileTX6; + } + } + else if (psFile->eFileType == AVCFileTOL) + { + /*------------------------------------------------------------- + * For some reason, the tolerance files do not follow the + * general rules! + * Single precision "tol.adf" have no header + * Double precision "par.adf" have the usual 100 bytes header, + * but the 3rd field, which usually defines the precision has + * a positive value, even if the file is double precision! + * + * Also, we have a problem with PC Arc/Info TOL files since they + * do not contain the first 256 bytes header either... so we will + * just assume that double precision TOL files cannot exist in + * PC Arc/Info coverages... this should be OK. + *------------------------------------------------------------*/ + int nSignature = 0; + nSignature = AVCRawBinReadInt32(psFile->psRawBinFile); + + if (nSignature == 9993) + { + /* We have a double precision par.adf... read the 100 bytes + * header and set the precision information inside the file + * handle. + */ @@ Diff output truncated at 100000 characters. @@ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ BRL-CAD Source Commits mailing list brlcad-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-commits