Skip to content

Commit

Permalink
Prototype using builder strategy object and general purpose vector ma…
Browse files Browse the repository at this point in the history
…p output format
  • Loading branch information
Gabriel Roldan committed Jun 19, 2015
1 parent 0cc9da3 commit b73a428
Show file tree
Hide file tree
Showing 10 changed files with 542 additions and 213 deletions.
@@ -0,0 +1,33 @@
package org.geoserver.wms.topojson;

import java.awt.Rectangle;
import java.util.Set;

import org.geoserver.wms.vector.VectorTileBuilder;
import org.geoserver.wms.vector.VectorTileBuilderFactory;
import org.geotools.geometry.jts.ReferencedEnvelope;

import com.google.common.collect.ImmutableSet;

public class TopoJSONBuilderFactory implements VectorTileBuilderFactory {

public static final String MIME_TYPE = "application/json;type=topojson";

public static final Set<String> OUTPUT_FORMATS = ImmutableSet.of(MIME_TYPE, "topojson");

@Override
public Set<String> getOutputFormats() {
return OUTPUT_FORMATS;
}

@Override
public String getMimeType() {
return MIME_TYPE;
}

@Override
public VectorTileBuilder newBuilder(Rectangle screenSize, ReferencedEnvelope mapArea) {
return new TopologyBuilder(screenSize, mapArea);
}

}
Expand Up @@ -352,6 +352,9 @@ public static JsonArray quantize(final CoordinateSequence coords, PrecisionModel
buff.x = deltaX; buff.x = deltaX;
buff.y = deltaY; buff.y = deltaY;
precisionModel.makePrecise(buff); precisionModel.makePrecise(buff);
if(buff.x == 0d && buff.y == 0d){
continue;
}
addCoordinate(arc, buff); addCoordinate(arc, buff);
} }
} }
Expand Down

This file was deleted.

0 comments on commit b73a428

Please sign in to comment.