Skip to content

Commit

Permalink
geodesic support
Browse files Browse the repository at this point in the history
  • Loading branch information
bosborn committed Feb 23, 2024
1 parent fa1e462 commit 135c5ba
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions src/main/java/mil/nga/geopackage/io/FeatureTileGen.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ public class FeatureTileGen {
*/
public static final String ARGUMENT_SIMPLIFY_GEOMETRIES = "simplifyGeometries";

/**
* Geodesic argument
*/
public static final String ARGUMENT_GEODESIC = "geodesic";

/**
* Ignore GeoPackage styles argument
*/
Expand Down Expand Up @@ -375,6 +380,11 @@ public class FeatureTileGen {
*/
private static boolean simplifyGeometries = true;

/**
* Draw geometries using geodesic lines
*/
private static boolean geodesic = false;

/**
* Ignore styles saved within the GeoPackage
*/
Expand Down Expand Up @@ -654,6 +664,16 @@ public void run() {
}
break;

case ARGUMENT_GEODESIC:
if (i + 1 < args.length) {
geodesic = Boolean.valueOf(args[++i]);
} else {
valid = false;
System.out.println("Error: Geodesic argument '" + arg
+ "' must be followed by a boolean value");
}
break;

case ARGUMENT_IGNORE_GEOPACKAGE_STYLES:
if (i + 1 < args.length) {
ignoreGeoPackageStyles = Boolean.valueOf(args[++i]);
Expand Down Expand Up @@ -863,7 +883,7 @@ public static void generate() {

// Index the feature table if needed
FeatureIndexManager indexManager = new FeatureIndexManager(
featureGeoPackage, featureDao);
featureGeoPackage, featureDao, geodesic);
if (!indexManager.isIndexed()) {
int numFeatures = featureDao.count();
LOGGER.log(Level.INFO,
Expand All @@ -885,7 +905,7 @@ public static void generate() {

// Create the feature tiles
FeatureTiles featureTiles = new DefaultFeatureTiles(featureGeoPackage,
featureDao);
featureDao, geodesic);
if (ignoreGeoPackageStyles) {
featureTiles.ignoreFeatureTableStyles();
}
Expand Down Expand Up @@ -1068,6 +1088,9 @@ public static void generate() {
if (simplifyGeometries) {
tileStyle.append(", Simplify Geometries");
}
if (geodesic) {
tileStyle.append(", Geodesic");
}
if (tileStyle.length() == 0) {
tileStyle.append(", Default Settings");
}
Expand Down Expand Up @@ -1152,6 +1175,7 @@ private static void printUsage() {
+ " color] [" + ARGUMENT_PREFIX + ARGUMENT_FILL_POLYGON + "] ["
+ ARGUMENT_PREFIX + ARGUMENT_POLYGON_FILL_COLOR + " color] ["
+ ARGUMENT_PREFIX + ARGUMENT_SIMPLIFY_GEOMETRIES
+ " true|false] [" + ARGUMENT_PREFIX + ARGUMENT_GEODESIC
+ " true|false] [" + ARGUMENT_PREFIX
+ ARGUMENT_IGNORE_GEOPACKAGE_STYLES + " true|false] ["
+ ARGUMENT_PREFIX + ARGUMENT_LOG_COUNT + " count] ["
Expand Down Expand Up @@ -1283,6 +1307,11 @@ private static void printUsage() {
System.out.println(
"\t\tFlag indicating whether geometries should be simplified with a similar curve with fewer points before drawn (default is true)");
System.out.println();
System.out.println(
"\t" + ARGUMENT_PREFIX + ARGUMENT_GEODESIC + " true|false");
System.out.println(
"\t\tFlag indicating whether geometries should be drawn as geodesic lines (default is false)");
System.out.println();
System.out.println("\t" + ARGUMENT_PREFIX
+ ARGUMENT_IGNORE_GEOPACKAGE_STYLES + " true|false");
System.out.println(
Expand Down

0 comments on commit 135c5ba

Please sign in to comment.