|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gisgraphy.domain.geoloc.entity.GisFeature
@Configurable public class GisFeature
GisFeature is the 'MotherClass of all Features. IMPORTANT Note about
admXCodes :
The AdmCode can have the value from the Geonames CSV file or the value from
the 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).
If syncAdmCodesWithLinkedAdmOnes is set to true then the Adm1Code will always
be the same as the getAdm()
.getAdm1Code
It depends on what you expect for Adm1Code : ADM values
(syncAdmCodesWithLinkedAdmOnes=true) or the CSV one
(syncAdmCodesWithLinkedAdmOnes=false)
ImporterConfig
Field Summary | |
---|---|
ICountryDao |
countryDao
|
static java.lang.String |
LOCATION_COLUMN_NAME
|
protected static org.slf4j.Logger |
logger
|
Constructor Summary | |
---|---|
GisFeature()
Default Constructor, needed by cgLib |
|
GisFeature(GisFeature gisFeature)
Copy Constructor that populate the current GisFeature with the
specified gisFeature fields |
Method Summary | |
---|---|
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(java.util.List<AlternateName> alternateNames)
Do a double set : add (not replace !) |
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(java.util.List<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 |
double |
distanceTo(com.vividsolutions.jts.geom.Point point)
Calculate the distance from the current GisFeature to the specified point. |
boolean |
equals(java.lang.Object obj)
|
Adm |
getAdm()
|
java.lang.String |
getAdm1Code()
Returns the Adm1Code for this feature. |
java.lang.String |
getAdm1Name()
Returns the name of the Adm of level 1 that this GisFeature is linked to. |
java.lang.String |
getAdm2Code()
Returns the Adm2Code for this feature. |
java.lang.String |
getAdm2Name()
Returns the name of the Adm of level 2 that this GisFeature is linked to. |
java.lang.String |
getAdm3Code()
Returns the Adm3Code for this feature. |
java.lang.String |
getAdm3Name()
Returns the name of the Adm of level 3 that this GisFeature is linked to. |
java.lang.String |
getAdm4Code()
Returns the Adm4Code for this feature. |
java.lang.String |
getAdm4Name()
Returns the name of the Adm of level 4 that this GisFeature is linked to. |
java.util.List<AlternateName> |
getAlternateNames()
|
java.lang.String |
getAsciiName()
|
Country |
getCountry()
|
java.lang.String |
getCountryCode()
The country code is not mandatory because gisfeature like undersea does not belongs to a country |
java.lang.Integer |
getElevation()
|
java.lang.String |
getFeatureClass()
|
java.lang.String |
getFeatureCode()
|
java.lang.Long |
getFeatureId()
|
java.lang.String |
getFullyQualifiedName()
|
java.lang.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) |
java.lang.Integer |
getGtopo30()
|
java.lang.Long |
getId()
The datastore id |
java.lang.Double |
getLatitude()
|
com.vividsolutions.jts.geom.Point |
getLocation()
Returns The JTS location point of the current GisFeature : The Geometry representation of the latitude, longitude. |
java.lang.Double |
getLongitude()
|
java.util.Date |
getModificationDate()
The modification date of the feature. |
java.lang.String |
getName()
|
java.lang.Integer |
getPopulation()
|
GISSource |
getSource()
|
java.lang.String |
getTimezone()
|
java.util.List<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(java.lang.String adm1Code)
|
void |
setAdm1Name(java.lang.String adm1Name)
Set the name of the Adm of level 1 that this GisFeature is linked to |
void |
setAdm2Code(java.lang.String adm2Code)
|
void |
setAdm2Name(java.lang.String adm2Name)
Set the name of the Adm of level 2 that this GisFeature is linked to |
void |
setAdm3Code(java.lang.String adm3Code)
|
void |
setAdm3Name(java.lang.String adm3Name)
Set the name of the Adm of level 3 that this GisFeature is linked to |
void |
setAdm4Code(java.lang.String adm4Code)
|
void |
setAdm4Name(java.lang.String adm4Name)
Set The name of the adm of level 4 that the GisFeature is linked to |
void |
setAlternateNames(java.util.List<AlternateName> alternateNames)
|
void |
setAsciiName(java.lang.String asciiname)
|
void |
setCountryCode(java.lang.String countryCode)
|
void |
setElevation(java.lang.Integer elevation)
|
void |
setFeatureClass(java.lang.String featureClass)
|
void |
setFeatureCode(java.lang.String featureCode)
|
void |
setFeatureId(java.lang.Long featureId)
A featureId is unique and mandatory |
void |
setGtopo30(java.lang.Integer gtopo30)
|
void |
setId(java.lang.Long id)
|
void |
setLocation(com.vividsolutions.jts.geom.Point location)
|
void |
setModificationDate(java.util.Date modificationDate)
|
void |
setName(java.lang.String name)
|
void |
setPopulation(java.lang.Integer population)
|
void |
setSource(GISSource source)
|
void |
setTimezone(java.lang.String timezone)
|
void |
setZipCodes(java.util.List<ZipCode> zipCodes)
Set The zipCodes for the city. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public ICountryDao countryDao
public static final java.lang.String LOCATION_COLUMN_NAME
protected static final org.slf4j.Logger logger
Constructor Detail |
---|
public GisFeature()
public GisFeature(GisFeature gisFeature)
GisFeature
with the
specified gisFeature fields
gisFeature
- The gisFeature from which we want to populate the
GisFeatureMethod Detail |
---|
public java.lang.Long getId()
public Country getCountry()
getCountryCode()
public java.lang.Double getLatitude()
getLocation()
.getLongitude()
,
getLocation()
public double distanceTo(com.vividsolutions.jts.geom.Point point)
point
- the JTS point we want to calculate the distance from
GeolocHelper.distance(Point, Point)
public com.vividsolutions.jts.geom.Point getLocation()
SRID
SRID
,
getLongitude()
,
getLocation()
public java.lang.Double getLongitude()
getLocation()
.getLongitude()
,
getLocation()
public java.util.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 java.lang.String getAdm1Code()
GisFeature
public void setAdm1Code(java.lang.String adm1Code)
adm1Code
- The adm1code to setgetAdm1Code()
public java.lang.String getAdm2Code()
GisFeature
public void setAdm2Code(java.lang.String adm2Code)
adm2Code
- the adm2code to setgetAdm2Code()
public java.lang.String getAdm3Code()
GisFeature
public void setAdm3Code(java.lang.String adm3Code)
adm3Code
- the adm3code to setgetAdm3Code()
public java.lang.String getAdm4Code()
GisFeature
public void setAdm4Code(java.lang.String adm4Code)
adm4Code
- the adm4code to setgetAdm4Code()
public java.lang.String getAdm1Name()
public void setAdm1Name(java.lang.String adm1Name)
adm1Name
- The name of the Adm of level 1 that this GisFeature is
linked togetAdm1Name()
public java.lang.String getAdm2Name()
public void setAdm2Name(java.lang.String adm2Name)
adm2Name
- The name of the Adm of level 2 that this GisFeature is
linked togetAdm2Name()
public java.lang.String getAdm3Name()
public void setAdm3Name(java.lang.String adm3Name)
adm3Name
- The name of the Adm of level 3 that this GisFeature is
linked togetAdm3Name()
public java.lang.String getAdm4Name()
public void setAdm4Name(java.lang.String adm4Name)
adm4Name
- The name of the adm of level 4 that the GisFeature is
linked togetAdm4Name()
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 java.util.List<AlternateName> getAlternateNames()
AlternateName
s for this GisFeaturepublic void setAlternateNames(java.util.List<AlternateName> alternateNames)
alternateNames
- The AlternateName
s for this GisFeaturepublic void addAlternateName(AlternateName alternateName)
alternateName
- the alternateName to addpublic void addAlternateNames(java.util.List<AlternateName> alternateNames)
alternateNames
- The alternateNames list to addpublic java.lang.String getAsciiName()
public void setAsciiName(java.lang.String asciiname)
asciiname
- The ASCII name of the current GisFeaturegetAsciiName()
public java.lang.String getCountryCode()
public void setCountryCode(java.lang.String countryCode)
countryCode
- The ISO 3166 alpha-2 letter code in upper Case (it will be
automatically uppercased)getCountryCode()
public java.lang.Integer getElevation()
public void setElevation(java.lang.Integer elevation)
elevation
- The elevation of this gisFeature (in meters)getElevation()
public java.lang.Integer getGtopo30()
public void setGtopo30(java.lang.Integer gtopo30)
gtopo30
- The average elevation of 30'x30' (900mx900m) area to
set in meterspublic java.lang.String getName()
public void setName(java.lang.String name)
name
- The UTF-8 name for the current GisFeaturepublic java.lang.Integer getPopulation()
public void setPopulation(java.lang.Integer population)
population
- The population (how many people are in) of this GisFeaturepublic GISSource getSource()
public void setSource(GISSource source)
source
- The source for the gisFeature to be setpublic java.lang.String getTimezone()
public void setTimezone(java.lang.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 setModificationDate(java.util.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(java.lang.Long id)
id
- The Id in the datastore. You should never call this
method. It is the responsability of the dataStoregetId()
public java.lang.Long getFeatureId()
public void setFeatureId(java.lang.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 code
public boolean isCountry()
FeatureClassCodeHelper
class. It does not check the Class but the
feature class and the feature code
public boolean isAdm()
FeatureClassCodeHelper
class. It does not check the Class but the
feature class and the feature code
public java.lang.String getFeatureClass()
public void setFeatureClass(java.lang.String featureClass)
featureClass
- The feature class to set. Note The featureClass
will automaticaly be uppercased.getFeatureClass()
public java.lang.String getFeatureCode()
FeatureCode
public void populate(GisFeature gisFeature)
gisFeature
- the gisFeature to populate withpublic void setFeatureCode(java.lang.String featureCode)
featureCode
- The feature Code for this GisFeature
Note The
featureCode will automaticaly be uppercasedgetFeatureCode()
public boolean isFullTextSearchable()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String getFullyQualifiedName(boolean withCountry)
withCountry
- Whether the country information should be added
public java.lang.String getFullyQualifiedName()
getFullyQualifiedName(boolean)
getFullyQualifiedName(boolean)
public java.lang.String toString()
toString
in class java.lang.Object
public void addZipCode(ZipCode zipCode)
zipCode
- the zip code to addpublic void addZipCodes(java.util.List<ZipCode> zipCodes)
public java.util.List<ZipCode> getZipCodes()
public void setZipCodes(java.util.List<ZipCode> zipCodes)
addZipCode(ZipCode)
and addZipCodes(List)
that do it automatically.
zipCodes
- The zip codes for the City
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |