Package com.microstrategy.web.app.maps
Class MapShapeRepository
- java.lang.Object
-
- com.microstrategy.web.app.maps.MapShapeRepository
-
- All Implemented Interfaces:
GeoDataRequestResultVisitor<MapShape>
,MapObjectRepository<MapShape>
public class MapShapeRepository extends java.lang.Object implements MapObjectRepository<MapShape>
The MapShapeRepository loads shape data from file databases and caches the geomtry data into memory.
-
-
Field Summary
Fields Modifier and Type Field Description java.lang.String
key
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addHierarchy(LookupRequest request, TreeSerializer tSerializer)
Add the shape hierarchy info into serializer.void
addMatchedMapObject(QueryRequest query, MapObjectSerializer<MapShape> moSerializer)
Add the matched map object into the map object serializer.void
addNameList(LookupRequest request, TreeSerializer tSerializer)
Add name list data into serializer.void
addTileMap(LookupRequest request, TreeSerializer tSerializer)
Add tile map to the target serializer to generate the tile data.GeoData
getCachedGeoData(java.lang.String cacheId)
Retrieve theGeoData
from the cache.static MapShapeRepository
getInstance()
protected static java.lang.String
getKey(java.lang.String name, java.lang.String type)
java.lang.String
getLookupKey(LookupRequest request)
The lookup key generated for a given query.MultiGeoPolygon
getShapeData(int shapeIndex)
java.lang.String
loadObjects(java.lang.String pathIn, java.lang.Integer shapeType)
Load objects from a specified location.java.lang.String
loadObjects(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.static com.microstrategy.web.app.maps.MapShapeRepository.NameLookup
loadShapeObjects(java.lang.String pathIn, java.lang.String dbName)
-
-
-
Method Detail
-
getInstance
public static MapShapeRepository getInstance()
-
getKey
protected static java.lang.String getKey(java.lang.String name, java.lang.String type)
-
getShapeData
public MultiGeoPolygon getShapeData(int shapeIndex)
-
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:MapObjectRepository
Load 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:
loadObjects
in 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.
-
loadShapeObjects
public static com.microstrategy.web.app.maps.MapShapeRepository.NameLookup loadShapeObjects(java.lang.String pathIn, java.lang.String dbName)
-
loadObjects
public java.lang.String loadObjects(java.lang.String pathIn, java.lang.Integer shapeType)
Description copied from interface:MapObjectRepository
Load 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:
loadObjects
in interfaceMapObjectRepository<MapShape>
- Parameters:
pathIn
- 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:GeoDataRequestResultVisitor
The lookup key generated for a given query.- Specified by:
getLookupKey
in interfaceGeoDataRequestResultVisitor<MapShape>
- Returns:
- A string represents the key to the lookup result of this query.
-
addTileMap
public void addTileMap(LookupRequest request, TreeSerializer tSerializer)
Add tile map to the target serializer to generate the tile data. The tile data is a map object with tile id as the key, and list of shape ids as the values.- Specified by:
addTileMap
in interfaceGeoDataRequestResultVisitor<MapShape>
- Parameters:
request
- The request for look up infotSerializer
- The serializer to hold the tile data
-
addNameList
public void addNameList(LookupRequest request, TreeSerializer tSerializer)
Add name list data into serializer. The name list data is grouped in the target types. Each target shape type/shape category, the shape name is the key, and the shape ids are the values who have the same name.- Specified by:
addNameList
in interfaceGeoDataRequestResultVisitor<MapShape>
- Parameters:
request
- ALookupRequest
object query for lookup info.tSerializer
- The serializer that can be serialized into target format.
-
addHierarchy
public void addHierarchy(LookupRequest request, TreeSerializer tSerializer)
Add the shape hierarchy info into serializer. The example of hierarchy data looks like: "1004:1003" as key, and map of "childShapeId:parentShapeId" as values- Specified by:
addHierarchy
in interfaceGeoDataRequestResultVisitor<MapShape>
- Parameters:
request
- ALookupRequest
object query for lookup info.tSerializer
- The serializer that can be serialized into target format.
-
addMatchedMapObject
public void addMatchedMapObject(QueryRequest query, MapObjectSerializer<MapShape> moSerializer)
Description copied from interface:GeoDataRequestResultVisitor
Add the matched map object into the map object serializer.- Specified by:
addMatchedMapObject
in interfaceGeoDataRequestResultVisitor<MapShape>
- Parameters:
query
- AQueryRequest
object query for shapes.moSerializer
- The map object serializer that serializes the map object into a target format.
-
getCachedGeoData
public GeoData getCachedGeoData(java.lang.String cacheId)
Description copied from interface:MapObjectRepository
Retrieve theGeoData
from 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:
getCachedGeoData
in interfaceMapObjectRepository<MapShape>
- Parameters:
cacheId
- The cache Id- Returns:
- See Also:
GeoData
-
-