public class

MapShapeRepository

extends Object
implements MapObjectRepository<T extends MapObject>
java.lang.Object
   ↳ com.microstrategy.web.app.maps.MapShapeRepository

Class Overview

The MapShapeRepository loads shape data from file databases and caches the geomtry data into memory.

Summary

Fields
public String key
Public Methods
void addHierarchy(LookupRequest request, TreeSerializer tSerializer)
Add the shape hierarchy info into serializer.
void addMatchedMapObject(QueryRequest query, MapObjectSerializer<MapShape> moSerializer)
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(String cacheId)
Retrieve the GeoData from the cache.
static MapShapeRepository getInstance()
String getLookupKey(LookupRequest request)
The lookup key generated for a given query.
MultiGeoPolygon getShapeData(int shapeIndex)
String loadObjects(String path, Integer shapeType, Map<String, String> queryName)
Load objects from a specified location with specified config object.
String loadObjects(String pathIn, Integer shapeType)
Load objects from a specified location.
static MapShapeRepository.NameLookup loadShapeObjects(String pathIn, String dbName)
Protected Methods
static String getKey(String name, String type)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.microstrategy.web.app.maps.GeoDataRequestResultVisitor
From interface com.microstrategy.web.app.maps.MapObjectRepository

Fields

public String key

Public Methods

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

Parameters
request A LookupRequest object query for lookup info.
tSerializer The serializer that can be serialized into target format.

public void addMatchedMapObject (QueryRequest query, MapObjectSerializer<MapShape> moSerializer)

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.

Parameters
request A LookupRequest object query for lookup info.
tSerializer The serializer that can be serialized into target format.

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.

Parameters
request The request for look up info
tSerializer The serializer to hold the tile data

public GeoData getCachedGeoData (String cacheId)

Retrieve the GeoData 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.

Parameters
cacheId The cache Id

public static MapShapeRepository getInstance ()

public String getLookupKey (LookupRequest request)

The lookup key generated for a given query.

Returns
  • A string represents the key to the lookup result of this query.

public MultiGeoPolygon getShapeData (int shapeIndex)

public String loadObjects (String path, Integer shapeType, Map<String, String> queryName)

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.

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.

public String loadObjects (String pathIn, Integer shapeType)

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.

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.

public static MapShapeRepository.NameLookup loadShapeObjects (String pathIn, String dbName)

Protected Methods

protected static String getKey (String name, String type)