Package io.goobi.viewer.controller
Class GeoCoordinateConverter
java.lang.Object
io.goobi.viewer.controller.GeoCoordinateConverter
Utility methods for converting geo-coordinated between different formats
- Author:
- florian
-
Field Summary
-
Constructor Summary
ConstructorDescriptionGeoCoordinateConverter
(String markerTitleConfig) GeoCoordinateConverter
(Map<String, Metadata> featureTitleConfigs, Map<String, Metadata> entityTitleConfigs) GeoCoordinateConverter
(javax.servlet.http.HttpServletRequest servletRequest) -
Method Summary
Modifier and TypeMethodDescriptionstatic de.intranda.metadata.multilanguage.IMetadataValue
createTitle
(Metadata labelConfig, Map<String, List<de.intranda.metadata.multilanguage.IMetadataValue>> metadata) getFeaturesFromSolrQuery
(String query, List<String> filterQueries, List<String> coordinateFields, String markerTitleField, boolean aggregateResults) Collect all point coordinate in the given coordinate fields from solr documents returned by the given solr querygetGeojsonPoints
(MetadataContainer doc, String metadataField, String titleField) getGeojsonPoints
(org.apache.solr.common.SolrDocument doc, String metadataField, String titleField) getGeojsonPoints
(org.apache.solr.common.SolrDocument doc, List<org.apache.solr.common.SolrDocument> children, String metadataField, String titleField) Collect all point coordinate in the given metadata field within the given solr documentParse geo-coordinates from the value of a SOLR fieldgetLocations
(String solrFieldName, org.apache.solr.common.SolrDocumentList results) Parse geo-coordinates from all fields of the given name fromt the given list of SOLR documentsgetSolrFieldsForExpandQuery
(List<String> coordinateFields, String markerTitleField) getSolrFieldsForMainQuery
(List<String> coordinateFields, String markerTitleField, boolean aggregateResults)
-
Field Details
-
POINT_LAT_LNG_PATTERN
- See Also:
-
POLYGON_LAT_LNG_PATTERN
- See Also:
-
-
Constructor Details
-
GeoCoordinateConverter
public GeoCoordinateConverter() -
GeoCoordinateConverter
-
GeoCoordinateConverter
-
GeoCoordinateConverter
public GeoCoordinateConverter(javax.servlet.http.HttpServletRequest servletRequest)
-
-
Method Details
-
getFeaturesFromSolrQuery
public List<GeoMapFeature> getFeaturesFromSolrQuery(String query, List<String> filterQueries, List<String> coordinateFields, String markerTitleField, boolean aggregateResults) throws PresentationException, IndexUnreachableException Collect all point coordinate in the given coordinate fields from solr documents returned by the given solr query- Parameters:
query
- Solr query to get documentsfilterQueries
- filter for solr querycoordinateFields
- fields containing the coordinate points to collectmarkerTitleField
- solr field containing a title for the coordinatesaggregateResults
-- Returns:
- a list of
GeoMapFeature
- Throws:
PresentationException
IndexUnreachableException
-
getSolrFieldsForMainQuery
-
getSolrFieldsForExpandQuery
-
getGeojsonPoints
public Collection<GeoMapFeature> getGeojsonPoints(org.apache.solr.common.SolrDocument doc, List<org.apache.solr.common.SolrDocument> children, String metadataField, String titleField) Collect all point coordinate in the given metadata field within the given solr document- Parameters:
doc
- the document containing the coordinateschildren
-metadataField
- The name of the solr field to search intitleField
- solr field containing a title for the coordinates- Returns:
- Collection
-
getGeojsonPoints
public Collection<GeoMapFeature> getGeojsonPoints(org.apache.solr.common.SolrDocument doc, String metadataField, String titleField) -
getGeojsonPoints
public Collection<GeoMapFeature> getGeojsonPoints(MetadataContainer doc, String metadataField, String titleField) -
createTitle
-
getLocations
public static List<Location> getLocations(String solrFieldName, org.apache.solr.common.SolrDocumentList results) Parse geo-coordinates from all fields of the given name fromt the given list of SOLR documents- Parameters:
solrFieldName
- Name of the SOLR fields to parseresults
- Documents to parse- Returns:
- A list of geo-coordinates as
Location
-
getLocations
Parse geo-coordinates from the value of a SOLR field- Parameters:
o
- SOLR field value- Returns:
- a list of
IArea
representing the locations from the given value
-