Skip to content
/ sxf4j Public

SXF (Storage and eXchange Format) open format digital map information for Java

License

Notifications You must be signed in to change notification settings

Lyoshes/sxf4j

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SXF (Storage and eXchange Format) open format digital map information for Java

Development for use SXF russian vector maps in java with support PostGIS and etc.

Library was designed according with documentation on SXF format of version 4 and SXF format of version 3. All documentation on Russian language.

Data on which are tested

separated

separated

Library based on Read/Write. On this moment supports:

  • Read SXF
  • Write SXF

Dependes:

  • Java Topology Suite (JTS) - for create geometry and provide them out in WKT, WKB, EWKT formats.
  • PROJ4J - for client side transform coordinates (only for sxf4j-utils).

Getting Started

mvn -U clean install

Using sxf4j as library:

int number = 3695;
File file = new File("src/test/resources/K37007.SXF");
SXFReader sxfReader = new SXFReader(file);
SXFRecord sxfRecord = sxfReader.getRecordByNumber(number);
// Native coordinates in map projection
Geometry geometry = sxfRecord.geometry();

sxfReader.close();

Command line tools

sxfinfo [<options>] <sxfile|dir>

This tool like as shp2pgsql with same flags and output formats.

Example usage:

./bin/sxfino -p FILE.SXF

./bin/sxfino -p -d FILE.SXF

./bin/sxfino -r number:3702 FILE.SXF

./bin/sxfino -rg number:3702 FILE.SXF

Command line flags:

Flag Description Required
-c Print record count No
-d Print descriptor of SXF NO
-f Flip coordinates
-gt All geometry print type (WKT, EWKT, WKB). Default: WKT. No
-h Print usage No
-p Print passport of SXF No
-q Not print warning messages No
-r Print record header, text (if exists), semantics (if exists) without geometry (incode:<i> - by incode, excode:<i> -by excode, number:<i> - by number No
-rg Print record geometry only (incode:<i> - by incode, excode:<i> - by excode, number:<i> - by number No
-s Set the SRID field. Defaults to 0. No

sxf2pgsql [<options>] <sxfile|dir> [[<schema>.]<table>]

./bin/sxf2pgsql.sh -d -s 4326 /Users/iserge/Develop/Map/500\ 000 | psql -U postgres sxf

separated

./bin/sxf2pgsql.sh -s 4326 /Users/iserge/Develop/Map/1\ 000\ 000 1kk | psql -U postgres sxf -q

many2one

Command line flags:

Flag Description Required
-c Creates a new table and populates it, this is the default if you do not specify any options. No
-d Drops the table, then recreates it and populates it with current shape file data. No
-e Execute each statement individually, do not use a transaction. Not compatible with -D. No
-g Specify the name of the geometry/geography column. No, default geog
-h Display this help screen. No
-I Create a spatial index on the geocolumn. No
-s Set the SRID field. Defaults to detect from passport or 0. Optionally reprojects from given SRID No
-t Use only PostGIS coordinates transform (ST_Transform), Use with -s option. Not worked with -D. Default: client side convert No
-T Specify the tablespace for the new table. Note that indexes will still use the default tablespace unless the -X flag is also used. No
-w Output WKT instead of WKB. Note that this can result in coordinate drift. No
-W Specify the character encoding of SXF attribute column. No, default UTF8
-X Specify the tablespace for the table's indexes. This applies to the primary key, index if the -I flag is used. No

About

SXF (Storage and eXchange Format) open format digital map information for Java

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published