public class GisFeature extends Object
getAdm()
.getAdm1Code It depends on the option
ImporterConfig.isSyncAdmCodesWithLinkedAdmOnes()
in the
env.properties file : Gisgraphy try to detect and correct errors in the CSV
files. If an error is detected or wrong Adm code are set, the Adm for this
GisFeature may not be the one that will be found from the Code in the CSV
file. If syncAdmCodesWithLinkedAdmOnes is set to false, the Adm1Code will be
set with the value of the CSV file (even if the no Adm are
found).getAdm()
.getAdm1CodeImporterConfig
Modifier and Type | Field and Description |
---|---|
static String |
LOCATION_COLUMN_NAME |
protected static org.slf4j.Logger |
logger |
static int |
MAX_ALTERNATENAME_SIZE |
static int |
NAME_MAX_LENGTH |
static String |
SHAPE_COLUMN_NAME |
Constructor and Description |
---|
GisFeature()
Default Constructor, needed by cgLib
|
GisFeature(GisFeature gisFeature)
Copy Constructor that populate the current
GisFeature with the
specified gisFeature fields |
Modifier and Type | Method and Description |
---|---|
void |
addAlternateName(AlternateName alternateName)
Do a double set : add the alternate name to the current GisFeature and set
this GisFeature as the GisFeature of the specified AlternateName
|
void |
addAlternateNames(List<AlternateName> alternateNames)
Do a double set : add (not replace !)
|
void |
addIsInCitiesAlternateName(String isInCityAlternateName) |
void |
addIsInCitiesAlternateNames(Collection<String> isInCityAlternateNames) |
void |
addZip(String zip)
add a zip
|
void |
addZipCode(ZipCode zipCode)
Do a double set : add the zip code to the current GisFeature and set
this GisFeature as the GisFeature of the zipcode
|
void |
addZipCodes(Collection<ZipCode> zipCodes)
Do a double set : add the zip codes to the current GisFeature and set
this GisFeature as the GisFeature of the zipcodes
* @param zipCodes the zip codes to add
|
void |
addZips(Collection<String> zips)
add zips
|
double |
distanceTo(com.vividsolutions.jts.geom.Point point)
Calculate the distance from the current GisFeature to the specified
point.
|
boolean |
equals(Object obj) |
Adm |
getAdm() |
String |
getAdm1Code()
Returns the Adm1Code for this feature.
|
String |
getAdm1Name()
Returns the name of the Adm of level 1 that this GisFeature is linked to.
|
String |
getAdm2Code()
Returns the Adm2Code for this feature.
|
String |
getAdm2Name()
Returns the name of the Adm of level 2 that this GisFeature is linked to.
|
String |
getAdm3Code()
Returns the Adm3Code for this feature.
|
String |
getAdm3Name()
Returns the name of the Adm of level 3 that this GisFeature is linked to.
|
String |
getAdm4Code()
Returns the Adm4Code for this feature.
|
String |
getAdm4Name()
Returns the name of the Adm of level 4 that this GisFeature is linked to.
|
String |
getAdm5Code()
Returns the Adm4Code for this feature.
|
String |
getAdm5Name()
Returns the name of the Adm of level 5 that this GisFeature is linked to.
|
Set<AlternateName> |
getAlternateNames() |
String |
getAmenity() |
String |
getAsciiName() |
Country |
getCountry() |
String |
getCountryCode()
The country code is not mandatory because gisfeature like undersea does
not belongs to a country
|
Integer |
getElevation() |
String |
getFeatureClass() |
String |
getFeatureCode() |
Long |
getFeatureId() |
String |
getFullyQualifiedName() |
String |
getFullyQualifiedName(boolean withCountry)
Returns a name of the form : (adm1Name et adm2Name are printed) Paris,
Département de Ville-De-Paris, Ile-De-France, (FR)
|
Integer |
getGtopo30() |
Long |
getId()
The datastore id
|
String |
getIsIn() |
String |
getIsInAdm() |
Set<String> |
getIsInCityAlternateNames()
This field is only for relevance and allow to search for street<->cities in
many alternateNames.
|
String |
getIsInPlace() |
Set<String> |
getIsInZip() |
Double |
getLatitude() |
com.vividsolutions.jts.geom.Point |
getLocation()
Returns The JTS location point of the current GisFeature : The Geometry
representation of the latitude, longitude.
|
Double |
getLongitude() |
Date |
getModificationDate()
The modification date of the feature.
|
String |
getName() |
Long |
getOpenstreetmapId() |
Integer |
getPopulation() |
com.vividsolutions.jts.geom.Geometry |
getShape()
Returns The JTS shape of the feature : The Return type is a JTS
geometry.
|
com.gisgraphy.domain.valueobject.GISSource |
getSource() |
String |
getTimezone() |
Set<ZipCode> |
getZipCodes() |
int |
hashCode() |
boolean |
isAdm()
Whether the feature is an Adm, in the sense we define it in the
FeatureClassCodeHelper class. |
boolean |
isCity()
Whether the feature is a city, in the sense we define it in the
FeatureClassCodeHelper class. |
boolean |
isCountry()
Whether the feature is a coutry, in the sense we define it in the
FeatureClassCodeHelper class. |
boolean |
isFullTextSearchable() |
void |
populate(GisFeature gisFeature)
Populate all the field / association of the current gisFeature with The
Value of The specified One.
|
void |
setAdm(Adm adm) |
void |
setAdm1Code(String adm1Code) |
void |
setAdm1Name(String adm1Name)
Set the name of the Adm of level 1 that this GisFeature is linked to
|
void |
setAdm2Code(String adm2Code) |
void |
setAdm2Name(String adm2Name)
Set the name of the Adm of level 2 that this GisFeature is linked to
|
void |
setAdm3Code(String adm3Code) |
void |
setAdm3Name(String adm3Name)
Set the name of the Adm of level 3 that this GisFeature is linked to
|
void |
setAdm4Code(String adm4Code) |
void |
setAdm4Name(String adm4Name)
Set The name of the adm of level 4 that the GisFeature is linked to
|
void |
setAdm5Code(String adm5Code) |
void |
setAdm5Name(String adm5Name)
Set The name of the adm of level 5 that the GisFeature is linked to
|
void |
setAlternateNames(Set<AlternateName> alternateNames) |
void |
setAmenity(String amenity) |
void |
setAsciiName(String asciiname) |
void |
setCountryCode(String countryCode) |
void |
setElevation(Integer elevation) |
void |
setFeatureClass(String featureClass) |
void |
setFeatureCode(String featureCode) |
void |
setFeatureId(Long featureId)
A featureId is unique and mandatory
|
void |
setGtopo30(Integer gtopo30) |
void |
setId(Long id) |
void |
setIsIn(String isIn) |
void |
setIsInAdm(String isInAdm) |
void |
setIsInCityAlternateNames(Set<String> isInCityAlternateNames) |
void |
setIsInPlace(String isInPlace) |
void |
setIsInZip(Set<String> isInZip) |
void |
setLocation(com.vividsolutions.jts.geom.Point location) |
void |
setModificationDate(Date modificationDate) |
void |
setName(String name) |
void |
setOpenstreetmapId(Long openstreetmapId) |
void |
setPopulation(Integer population) |
void |
setShape(com.vividsolutions.jts.geom.Geometry shape) |
void |
setSource(com.gisgraphy.domain.valueobject.GISSource source) |
void |
setTimezone(String timezone) |
void |
setZipCodes(Set<ZipCode> zipCodes)
Set The zipCodes for the city.
|
String |
toString() |
public static final int NAME_MAX_LENGTH
public static final String SHAPE_COLUMN_NAME
public static final String LOCATION_COLUMN_NAME
protected static final org.slf4j.Logger logger
public static final int MAX_ALTERNATENAME_SIZE
public GisFeature()
public GisFeature(GisFeature gisFeature)
GisFeature
with the
specified gisFeature fieldsgisFeature
- The gisFeature from which we want to populate the
GisFeaturepublic Long getId()
public Country getCountry()
getCountryCode()
public Double getLatitude()
getLocation()
.getLongitude()
,
getLocation()
public double distanceTo(com.vividsolutions.jts.geom.Point point)
point
- the JTS point we want to calculate the distance fromGeolocHelper.distance(Point, Point)
public com.vividsolutions.jts.geom.Point getLocation()
SRID
SRID
,
getLongitude()
,
getLocation()
public com.vividsolutions.jts.geom.Geometry getShape()
SRID
,
getLongitude()
,
getLocation()
public Double getLongitude()
getLocation()
.getLongitude()
,
getLocation()
public Date getModificationDate()
Constants.GIS_DATE_PATTERN
This fields is not updated when saving
or updating a GisFeature. This fields is to track changes in the
gazetteers, not in the Datastore.public String getAdm1Code()
GisFeature
public void setAdm1Code(String adm1Code)
adm1Code
- The adm1code to setgetAdm1Code()
public String getAdm2Code()
GisFeature
public void setAdm2Code(String adm2Code)
adm2Code
- the adm2code to setgetAdm2Code()
public String getAdm3Code()
GisFeature
public void setAdm3Code(String adm3Code)
adm3Code
- the adm3code to setgetAdm3Code()
public String getAdm4Code()
GisFeature
public void setAdm4Code(String adm4Code)
adm4Code
- the adm4code to setgetAdm4Code()
public String getAdm5Code()
GisFeature
public void setAdm5Code(String adm5Code)
adm5Code
- the adm5Code to setgetAdm4Code()
public String getAdm1Name()
public void setAdm1Name(String adm1Name)
adm1Name
- The name of the Adm of level 1 that this GisFeature is
linked togetAdm1Name()
public String getAdm2Name()
public void setAdm2Name(String adm2Name)
adm2Name
- The name of the Adm of level 2 that this GisFeature is
linked togetAdm2Name()
public String getAdm3Name()
public void setAdm3Name(String adm3Name)
adm3Name
- The name of the Adm of level 3 that this GisFeature is
linked togetAdm3Name()
public String getAdm4Name()
public void setAdm4Name(String adm4Name)
adm4Name
- The name of the adm of level 4 that the GisFeature is
linked togetAdm4Name()
public String getAdm5Name()
public void setAdm5Name(String adm5Name)
adm5Name
- The name of the adm of level 5 that the GisFeature is
linked togetAdm5Name()
public Adm getAdm()
GisFeature
public void setAdm(Adm adm)
adm
- The Adm with the higher Level that this GisFeature is
linked to (the deeper in the Adm tree).getAdm()
public Set<AlternateName> getAlternateNames()
AlternateName
s for this GisFeaturepublic void setAlternateNames(Set<AlternateName> alternateNames)
alternateNames
- The AlternateName
s for this GisFeaturepublic void addAlternateName(AlternateName alternateName)
alternateName
- the alternateName to addpublic void addAlternateNames(List<AlternateName> alternateNames)
alternateNames
- The alternateNames list to addpublic String getAsciiName()
public void setAsciiName(String asciiname)
asciiname
- The ASCII name of the current GisFeaturegetAsciiName()
public String getCountryCode()
public void setCountryCode(String countryCode)
countryCode
- The ISO 3166 alpha-2 letter code in upper Case (it will be
automatically uppercased)getCountryCode()
public Integer getElevation()
public void setElevation(Integer elevation)
elevation
- The elevation of this gisFeature (in meters)getElevation()
public Integer getGtopo30()
public void setGtopo30(Integer gtopo30)
gtopo30
- The average elevation of 30'x30' (900mx900m) area to
set in meterspublic String getName()
public void setName(String name)
name
- The UTF-8 name for the current GisFeaturepublic Integer getPopulation()
public void setPopulation(Integer population)
population
- The population (how many people are in) of this GisFeaturepublic com.gisgraphy.domain.valueobject.GISSource getSource()
public void setSource(com.gisgraphy.domain.valueobject.GISSource source)
source
- The source for the gisFeature to be setpublic void setTimezone(String timezone)
timezone
- The timeZone for This GisFeaturegetTimezone()
public void setLocation(com.vividsolutions.jts.geom.Point location)
location
- The location of the GisFeature (JTS point)getLocation()
,
getLatitude()
,
getLongitude()
public void setShape(com.vividsolutions.jts.geom.Geometry shape)
shape
- The shape of the GisFeature (JTS)getShape()
public void setModificationDate(Date modificationDate)
modificationDate
- The Date of the Last Modification. This fields is not
updated when saving or updating a GisFeature : This fields
is to track changes in the gazetteers, not in the
datastore. The date should match the
Constants.GIS_DATE_PATTERN
getModificationDate()
public void setId(Long id)
id
- The Id in the datastore. You should never call this
method. It is the responsability of the dataStoregetId()
public Long getFeatureId()
public void setFeatureId(Long featureId)
featureId
- The featureId for this GisFeaturepublic boolean isCity()
FeatureClassCodeHelper
class. It does not check the Class but the
feature class and the feature codepublic boolean isCountry()
FeatureClassCodeHelper
class. It does not check the Class but the
feature class and the feature codepublic boolean isAdm()
FeatureClassCodeHelper
class. It does not check the Class but the
feature class and the feature codepublic String getFeatureClass()
public void setFeatureClass(String featureClass)
featureClass
- The feature class to set. Note The featureClass
will automaticaly be uppercased.getFeatureClass()
public String getFeatureCode()
FeatureCode
public void populate(GisFeature gisFeature)
gisFeature
- the gisFeature to populate withpublic void setFeatureCode(String featureCode)
featureCode
- The feature Code for this GisFeature
Note The
featureCode will automaticaly be uppercasedgetFeatureCode()
public boolean isFullTextSearchable()
public String getFullyQualifiedName(boolean withCountry)
withCountry
- Whether the country information should be addedpublic String getFullyQualifiedName()
getFullyQualifiedName(boolean)
getFullyQualifiedName(boolean)
public void addZipCode(ZipCode zipCode)
zipCode
- the zip code to addpublic void addZipCodes(Collection<ZipCode> zipCodes)
public void setZipCodes(Set<ZipCode> zipCodes)
addZipCode(ZipCode)
and addZipCodes(Collection)
that do it automatically.zipCodes
- The zip codes for the Citypublic String getAmenity()
public void setAmenity(String amenity)
amenity
- the amenity tag
(typically the osm tag)public Long getOpenstreetmapId()
public void setOpenstreetmapId(Long openstreetmapId)
openstreetmapId
- The openstreetmap id of the POIpublic String getIsIn()
public void setIsIn(String isIn)
isIn
- The city or state or any information where the street is
locatedpublic String getIsInPlace()
OpenStreetMap.isIn
is filled and we got more specific details (generally quarter, neighborhood)public void setIsInPlace(String isInPlace)
isInPlace
- the most precise information on where the street is located,
generally quarter neighborhoodpublic String getIsInAdm()
public void setIsInAdm(String isInAdm)
isInAdm
- the adm (aka administrative division) where the street is locatedpublic void setIsInZip(Set<String> isInZip)
isInZip
- the zipcode where the street is located.public void addZip(String zip)
public void addZips(Collection<String> zips)
public Set<String> getIsInCityAlternateNames()
public void addIsInCitiesAlternateName(String isInCityAlternateName)
public void addIsInCitiesAlternateNames(Collection<String> isInCityAlternateNames)
Copyright © 2015. All rights reserved.