Package com.microstrategy.web.app.maps
Class KMLShapeRepository
- java.lang.Object
-
- com.microstrategy.web.app.maps.KMLShapeRepository
-
- All Implemented Interfaces:
GeoDataRequestResultVisitor<MapShape>,MapObjectRepository<MapShape>
public class KMLShapeRepository extends java.lang.Object implements MapObjectRepository<MapShape>
The repository loads the kml files and creates and caches the @{link KMLObject} into memory for query.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHierarchy(LookupRequest request, TreeSerializer tSerializer)Add the shape hierarchy data into tree serializer.voidaddMatchedMapObject(QueryRequest query, MapObjectSerializer<MapShape> moSerializer)Add the matched map object into the map object serializer.voidaddNameList(LookupRequest request, TreeSerializer tSerializer)Add the name shapeIds map data into tree serializer.voidaddTileMap(LookupRequest request, TreeSerializer tSerializer)Add the tile data into tree serializer.intcheckRingIsClockwise(double[][] p)GeoDatagetCachedGeoData(java.lang.String cacheId)Retrieve theGeoDatafrom the cache.static KMLShapeRepositorygetInstance()java.util.List<KMLObject>getKMLObjects(java.lang.String path)java.lang.StringgetLookupKey(LookupRequest request)The lookup key generated for a given query.java.lang.StringloadObjects(java.lang.String path, java.lang.Integer shapeType)Load objects from a specified location.java.lang.StringloadObjects(java.lang.String path, java.lang.Integer shapeType, java.util.Map<java.lang.String,java.lang.String> queryName)Load objects from a specified location with specified config object.voidsetQueryField(java.lang.String queryField)GeoDatashpPolygonToKmlModel(double[][][] points)
-
-
-
Method Detail
-
getInstance
public static KMLShapeRepository getInstance()
-
setQueryField
public void setQueryField(java.lang.String queryField)
-
getCachedGeoData
public GeoData getCachedGeoData(java.lang.String cacheId)
Description copied from interface:MapObjectRepositoryRetrieve theGeoDatafrom the cache. The repository is responsible to cache the geometry data. If cache is missing, it should read it from file system and reset the cache and then returns the data object.- Specified by:
getCachedGeoDatain interfaceMapObjectRepository<MapShape>- Parameters:
cacheId- The cache Id- Returns:
- See Also:
GeoData
-
loadObjects
public java.lang.String loadObjects(java.lang.String path, java.lang.Integer shapeType, java.util.Map<java.lang.String,java.lang.String> queryName)Description copied from interface:MapObjectRepositoryLoad objects from a specified location with specified config object. If the shapeType is already defined in file, then ignore the parameter. Otherwise, assign the type for each shape loaded from the path.- Specified by:
loadObjectsin interfaceMapObjectRepository<MapShape>- Parameters:
path- The path to the location where the file located.shapeType- An integer representing the shape category / shape type for the shapes that are saved into repository.queryName- A map object contains name-value pair. Example: use queryField as the key and kml path as the value- Returns:
- A string as key to access the loaded object later.
-
loadObjects
public java.lang.String loadObjects(java.lang.String path, java.lang.Integer shapeType)Description copied from interface:MapObjectRepositoryLoad objects from a specified location. If the shapeType is already defined in file, then ignore the parameter. Otherwise, assign the type for each shape loaded from the path.- Specified by:
loadObjectsin interfaceMapObjectRepository<MapShape>- Parameters:
path- The path to the location where the file located.shapeType- An integer representing the shape category / shape type for the shapes that are saved into repository.- Returns:
- A string as key to access the loaded object later.
-
getLookupKey
public java.lang.String getLookupKey(LookupRequest request)
Description copied from interface:GeoDataRequestResultVisitorThe lookup key generated for a given query.- Specified by:
getLookupKeyin interfaceGeoDataRequestResultVisitor<MapShape>- Returns:
- A string represents the key to the lookup result of this query.
-
addTileMap
public void addTileMap(LookupRequest request, TreeSerializer tSerializer)
Description copied from interface:GeoDataRequestResultVisitorAdd the tile data into tree serializer.- Specified by:
addTileMapin interfaceGeoDataRequestResultVisitor<MapShape>- Parameters:
request- ALookupRequestobject query for lookup info.tSerializer- The serializer that can be serialized into target format.
-
addNameList
public void addNameList(LookupRequest request, TreeSerializer tSerializer)
Description copied from interface:GeoDataRequestResultVisitorAdd the name shapeIds map data into tree serializer.- Specified by:
addNameListin interfaceGeoDataRequestResultVisitor<MapShape>- Parameters:
request- ALookupRequestobject query for lookup info.tSerializer- The serializer that can be serialized into target format.
-
addHierarchy
public void addHierarchy(LookupRequest request, TreeSerializer tSerializer)
Description copied from interface:GeoDataRequestResultVisitorAdd the shape hierarchy data into tree serializer.- Specified by:
addHierarchyin interfaceGeoDataRequestResultVisitor<MapShape>- Parameters:
request- ALookupRequestobject query for lookup info.tSerializer- The serializer that can be serialized into target format.
-
getKMLObjects
public java.util.List<KMLObject> getKMLObjects(java.lang.String path)
-
addMatchedMapObject
public void addMatchedMapObject(QueryRequest query, MapObjectSerializer<MapShape> moSerializer)
Description copied from interface:GeoDataRequestResultVisitorAdd the matched map object into the map object serializer.- Specified by:
addMatchedMapObjectin interfaceGeoDataRequestResultVisitor<MapShape>- Parameters:
query- AQueryRequestobject query for shapes.moSerializer- The map object serializer that serializes the map object into a target format.
-
shpPolygonToKmlModel
public GeoData shpPolygonToKmlModel(double[][][] points)
-
checkRingIsClockwise
public int checkRingIsClockwise(double[][] p)
-
-