Package de.narimo.georepo.server
Class GeorepoTools
- java.lang.Object
-
- de.narimo.georepo.server.GeorepoTools
-
public class GeorepoTools extends Object
-
-
Constructor Summary
Constructors Constructor Description GeorepoTools()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static StringcopyFileToImportDir(String geoserverDataDir, String workspace, String csvFileName)static StringcreateAlphanumericString(int count)static StringgetFileExtension(String absFileName)Returns the extension of a file as after the last ".".static StringimportEmptyLayer(javax.servlet.ServletContext context, int srid, String readableLayerName, String workspace, String[] columnHeaders, String[] columnTypes, GeometryType geometryType)static StringimportGeoCSV(javax.servlet.ServletContext context, String geoserverDataDir, int srid, String delimiter, String csvFileName, String readableLayerName, String workspace, String[] optColumnTypes)static javax.ws.rs.core.ResponseimportShape(javax.servlet.ServletContext context, String geoserverDataDir, String sridAsString, String shpFileName, String readableLayerName, String[] optColumnTypes)Deprecated.not up to date.static booleanisAlphaNumeric(String s)Checks a string for only occurrences of alphanumeric characters including underscore.static voidmain(String[] args)static Stringnormalize(String input)Removes special chars, retains underscore.static javax.ws.rs.core.ResponsereplaceGeoCSVLayer(javax.servlet.ServletContext context, String geoserverDataDir, int srid, String delimiter, String csvFileName, String workspace, String optColumnTypes, int layerId)
-
-
-
Method Detail
-
importGeoCSV
public static String importGeoCSV(javax.servlet.ServletContext context, String geoserverDataDir, int srid, String delimiter, String csvFileName, String readableLayerName, String workspace, String[] optColumnTypes) throws Exception
- Throws:
Exception
-
importEmptyLayer
public static String importEmptyLayer(javax.servlet.ServletContext context, int srid, String readableLayerName, String workspace, String[] columnHeaders, String[] columnTypes, GeometryType geometryType) throws Exception
- Throws:
Exception
-
replaceGeoCSVLayer
public static javax.ws.rs.core.Response replaceGeoCSVLayer(javax.servlet.ServletContext context, String geoserverDataDir, int srid, String delimiter, String csvFileName, String workspace, String optColumnTypes, int layerId) throws Exception- Throws:
Exception
-
importShape
public static javax.ws.rs.core.Response importShape(javax.servlet.ServletContext context, String geoserverDataDir, String sridAsString, String shpFileName, String readableLayerName, String[] optColumnTypes) throws IOExceptionDeprecated.not up to date. see importGeoCSV- Parameters:
geoserverDataDir-sridAsString-shpFileName-readableLayerName-- Returns:
- Throws:
ExceptionIOException
-
copyFileToImportDir
public static String copyFileToImportDir(String geoserverDataDir, String workspace, String csvFileName) throws IOException
- Throws:
IOException
-
getFileExtension
public static String getFileExtension(String absFileName)
Returns the extension of a file as after the last ".".- Parameters:
absFileName-- Returns:
-
normalize
public static String normalize(String input) throws IOException
Removes special chars, retains underscore. Converts space, tab and linebreak to underscore. Converts umlaute. Converts to lower case. TODO: what about diacritics?- Parameters:
inputz-- Returns:
- Throws:
IOException
-
isAlphaNumeric
public static boolean isAlphaNumeric(String s)
Checks a string for only occurrences of alphanumeric characters including underscore.- Parameters:
s-- Returns:
-
createAlphanumericString
public static String createAlphanumericString(int count)
-
main
public static void main(String[] args) throws IOException
- Throws:
IOException
-
-