- java.lang.Object
-
- org.arakhne.afc.io.shape.ESRIFileUtil
-
public final class ESRIFileUtil extends Object
Constants and utility functions for ESRI shape files.The specification of the ESRI Shape file format is described in the July 98 specification document.
- Since:
- 14.0
- Version:
- 17.0 2020-01-04 14:41:52
- Author:
- Stéphane GALLAND, Olivier LAMOTTE
- Maven Group Id:
- org.arakhne.afc.advanced
- Maven Artifact Id:
- shapefile
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ESRIFileUtil.NullFactory
A factory that creates nothing.
-
Field Summary
Fields Modifier and Type Field Description static double
ESRI_NAN
NaN value for floating point numbers in ESRI files.static int
HEADER_BYTES
Size (in bytes) of the standard shape file header.static int
SHAPE_FILE_CODE
Code which is identifying the ESRI shape files.static int
SHAPE_FILE_VERSION
Version of the ESRI shape file syntax.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static double
fromESRI(double value)
Translate a floating point value from ESRI standard.static float
fromESRI(float value)
Translate a floating point value from ESRI standard.static double
fromESRI_m(double meeasure)
Translate a m-coordinate from ESRI standard to Java standard.static double
fromESRI_x(double x)
Translate a x-coordinate from ESRI standard to Java standard.static double
fromESRI_y(double y)
Translate a y-coordinate from ESRI standard to Java standard.static double
fromESRI_z(double z)
Translate a z-coordinate from ESRI standard to Java standard.protected static int
fromESRIWords(int wordCount)
Replies the count of bytes from an ESRI file and which is corresponding to the given 16-bit word amount.static URL
generateShapeFileIndexFromShapeFile(File shapeFile)
Generate a shape file index (.shx) from an ESRI shape file (.shp).static boolean
isESRINaN(double value)
Replies if the given value is assumed to be NaN according to the ESRI specifications.static boolean
isESRINaN(float value)
Replies if the given value is assumed to be NaN according to the ESRI specifications.static double
toESRI(double value)
Translate a floating point value into ESRI standard.static double
toESRI(float value)
Translate a floating point value into ESRI standard.static double
toESRI_m(double measure)
Translate a M-coordinate from Java standard to ESRI standard.static double
toESRI_x(double x)
Translate a x-coordinate from Java standard to ESRI standard.static double
toESRI_y(double y)
Translate a y-coordinate from Java standard to ESRI standard.static double
toESRI_z(double z)
Translate a z-coordinate from Java standard to ESRI standard.protected static int
toESRIWords(int byteCount)
Replies the count of words to put inside an ESRI file and which is corresponding to the given byte amount.
-
-
-
Field Detail
-
SHAPE_FILE_CODE
public static final int SHAPE_FILE_CODE
Code which is identifying the ESRI shape files.- See Also:
- Constant Field Values
-
SHAPE_FILE_VERSION
public static final int SHAPE_FILE_VERSION
Version of the ESRI shape file syntax.- See Also:
- Constant Field Values
-
ESRI_NAN
public static final double ESRI_NAN
NaN value for floating point numbers in ESRI files.- See Also:
- Constant Field Values
-
HEADER_BYTES
public static final int HEADER_BYTES
Size (in bytes) of the standard shape file header.- See Also:
- Constant Field Values
-
-
Method Detail
-
toESRIWords
protected static int toESRIWords(int byteCount)
Replies the count of words to put inside an ESRI file and which is corresponding to the given byte amount.- Parameters:
byteCount
- the number of bytes- Returns:
- the count of words (ie.
byteCount/2
).
-
fromESRIWords
protected static int fromESRIWords(int wordCount)
Replies the count of bytes from an ESRI file and which is corresponding to the given 16-bit word amount.- Parameters:
wordCount
- number of words.- Returns:
- the count of bytes (ie.
byteCount*2
).
-
toESRI_x
@Pure public static double toESRI_x(double x) throws IOException
Translate a x-coordinate from Java standard to ESRI standard.- Parameters:
x
- is the Java x-coordinate- Returns:
- the ESRI x-coordinate
- Throws:
IOException
- when invalid conversion.
-
fromESRI_x
@Pure public static double fromESRI_x(double x) throws IOException
Translate a x-coordinate from ESRI standard to Java standard.- Parameters:
x
- is the Java x-coordinate- Returns:
- the ESRI x-coordinate
- Throws:
IOException
- when invalid conversion.
-
toESRI_y
@Pure public static double toESRI_y(double y) throws IOException
Translate a y-coordinate from Java standard to ESRI standard.- Parameters:
y
- is the Java y-coordinate- Returns:
- the ESRI y-coordinate
- Throws:
IOException
- when invalid conversion.
-
fromESRI_y
@Pure public static double fromESRI_y(double y) throws IOException
Translate a y-coordinate from ESRI standard to Java standard.- Parameters:
y
- is the Java y-coordinate- Returns:
- the ESRI y-coordinate
- Throws:
IOException
- when invalid conversion.
-
toESRI_z
@Pure public static double toESRI_z(double z)
Translate a z-coordinate from Java standard to ESRI standard.- Parameters:
z
- is the Java z-coordinate- Returns:
- the ESRI z-coordinate
-
fromESRI_z
@Pure public static double fromESRI_z(double z)
Translate a z-coordinate from ESRI standard to Java standard.- Parameters:
z
- is the Java z-coordinate- Returns:
- the ESRI z-coordinate
-
toESRI_m
@Pure public static double toESRI_m(double measure)
Translate a M-coordinate from Java standard to ESRI standard.- Parameters:
measure
- is the Java z-coordinate- Returns:
- the ESRI m-coordinate
-
fromESRI_m
@Pure public static double fromESRI_m(double meeasure)
Translate a m-coordinate from ESRI standard to Java standard.- Parameters:
meeasure
- is the Java m-coordinate- Returns:
- the ESRI m-coordinate
-
isESRINaN
@Pure public static boolean isESRINaN(double value)
Replies if the given value is assumed to be NaN according to the ESRI specifications.- Parameters:
value
- the value.- Returns:
true
if the value corresponds to NaN, otherwisefalse
.
-
isESRINaN
@Pure public static boolean isESRINaN(float value)
Replies if the given value is assumed to be NaN according to the ESRI specifications.- Parameters:
value
- the value.- Returns:
true
if the value corresponds to NaN, otherwisefalse
.
-
toESRI
@Pure public static double toESRI(double value)
Translate a floating point value into ESRI standard.This function translate the Java NaN and infinites values into the ESRI equivalent value.
- Parameters:
value
- the value.- Returns:
- the ESRI value
-
toESRI
@Pure public static double toESRI(float value)
Translate a floating point value into ESRI standard.This function translate the Java NaN and infinites values into the ESRI equivalent value.
- Parameters:
value
- the value.- Returns:
- the ESRI value
-
fromESRI
@Pure public static double fromESRI(double value)
Translate a floating point value from ESRI standard.This function translate the ESRI "no data" value into the NaN value.
- Parameters:
value
- the value.- Returns:
- the Java value
-
fromESRI
@Pure public static float fromESRI(float value)
Translate a floating point value from ESRI standard.This function translate the ESRI "no data" value into the NaN value.
- Parameters:
value
- the value.- Returns:
- the Java value
-
generateShapeFileIndexFromShapeFile
@Pure public static URL generateShapeFileIndexFromShapeFile(File shapeFile) throws IOException
Generate a shape file index (.shx) from an ESRI shape file (.shp).- Parameters:
shapeFile
- is the ESRI shape file.- Returns:
- the index filename.
- Throws:
IOException
- when invalid conversion.
-
-