Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.gisgraphy.domain.geoloc.entity
Class GisFeature

    java.lang.Object
      com.gisgraphy.domain.geoloc.entity.GisFeature

Direct Known Subclasses:
  Adm, Airport, AmusePark, Aqueduc, ATM, Bank, Bar, Bay, Beach, Bridge, Building, BusStation, Camp, Canyon, Casino, Castle, Cemetery, Cirque, City, CitySubdivision, Cliff, Coast, Continent, Country, CourtHouse, CustomsPost, Dam, Desert, Factory, Falls, Farm, Field, FishingArea, Fjord, Forest, Garden, Golf, Gorge, GrassLand, Gulf, Hill, Hospital, Hotel, House, Ice, Island, Lake, Library, LightHouse, Mall, Marsh, MetroStation, Military, Mill, Mine, Mole, Monument, Mound, Mountain, Museum, Oasis, ObservatoryPoint, Ocean, OperaHouse, Park, Parking, Plantation, PolicePost, PoliticalEntity, Pond, Port, PostOffice, Prison, Pyramid, Quay, Rail, RailRoadStation, Ranch, Ravin, Reef, Religious, Reserve, Restaurant, Road, School, Sea, Spring, Stadium, Strait, Stream, Street, Theater, Tower, Tree, Tunnel, UnderSea, Vineyard, Volcano, WaterBody, Zoo

    @Configurable
    public class GisFeature

extends java.lang.Object

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 : redondance (syncAdmCodesWithLinkedAdmOnes=true) or the CSV data (syncAdmCodesWithLinkedAdmOnes=false)

Author:
  David Masclet
See Also:
  `ImporterConfig`

Field Summary
`ICountryDao` | `countryDao`
`static java.lang.String` | `LOCATION_COLUMN_NAME`
`protected static org.slf4j.Logger` | `logger`

Constructor Summary
`GisFeature()` Default Constructor
`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 AlternateName 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 !)
`double` | `distance(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(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 for 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()`
`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)`
`java.lang.String` | `toString()`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### countryDao

    public ICountryDao countryDao

### LOCATION_COLUMN_NAME

    public static final java.lang.String LOCATION_COLUMN_NAME

See Also:
  Constant Field Values

### logger

    protected static final org.slf4j.Logger logger

Constructor Detail

### GisFeature

    public GisFeature()

  Default Constructor

### GisFeature

    public GisFeature(GisFeature gisFeature)

  Copy Constructor that populate the current `GisFeature` with the specified gisFeature fields

  Parameters:
    `gisFeature` - The gisFeature from which we want to populate the GisFeature

Method Detail

### getId

    public java.lang.Long getId()

  The datastore id

  Returns:
    The DatastoreId, it is not a domain value, just a technical One

### getCountry

    public Country getCountry()

  Returns:
    the country from the CountryCode. Return null if the countryCode is null or if no country is found

### getLatitude

    public java.lang.Double getLatitude()

  Returns:
    Returns the latitude (north-south) from the Location `getLocation()`.
  See Also:
    `getLongitude()`, `getLocation()`

### distance

    public double distance(com.vividsolutions.jts.geom.Point point)

  Calculate the distance from the current GisFeature to the specified point.

  Parameters:
    `point` - the JTS point from which we want to calculate the distance
  Returns:
    the calculated distance
  See Also:
    `GeolocHelper.distance(Point, Point)`

### getLocation

    public com.vividsolutions.jts.geom.Point getLocation()

  Returns The JTS location point of the current GisFeature : The Geometry representation for the latitude, longitude. The Return type is a JTS point. The Location is calculate from the 4326 `SRID`

  Returns:
    The JTS Point
  See Also:
    `SRID`, `getLongitude()`, `getLocation()`

### getLongitude

    public java.lang.Double getLongitude()

  Returns:
    Returns the longitude (east-West) from the Location `getLocation()`.
  See Also:
    `getLongitude()`, `getLocation()`

### getModificationDate

    public java.util.Date getModificationDate()

  The modification date of the feature. The date must match the `Constants.GIS_DATE_PATTERN` This fields is not updated when saving or updating a GisFeature : This fields is to track change in the gazetteers, not in the Datastore.

  Returns:
    The modification date of the feature

### getAdm1Code

    public java.lang.String getAdm1Code()

  Returns the Adm1Code for this feature. The only goal to have the Adm1Code directly in the GisFeature is for performance reason :
  It allows to have the adm1Code without loading all the Adm tree. See Important Notes for admXcode for `GisFeature`

  Returns:
    The Adm1Code for this Feature

### setAdm1Code

    public void setAdm1Code(java.lang.String adm1Code)

  Parameters:
    `adm1Code` - the adm1code to set
  See Also:
    `getAdm1Code()`

### getAdm2Code

    public java.lang.String getAdm2Code()

  Returns the Adm2Code for this feature. The only goal to have the Adm2Code directly in the GisFeature is for performance reason :
  It allows to have the adm2Code without loading all the Adm tree. See Important Notes for admXcode for `GisFeature`

  Returns:
    The Adm2Code for this Feature

### setAdm2Code

    public void setAdm2Code(java.lang.String adm2Code)

  Parameters:
    `adm2Code` - the adm2code to set
  See Also:
    `getAdm2Code()`

### getAdm3Code

    public java.lang.String getAdm3Code()

  Returns the Adm3Code for this feature. The only goal to have the Adm3Code directly in the GisFeature is for performance reason :
  It allows to have the adm3Code without loading all the Adm tree. See Important Notes for admXcode for `GisFeature`

  Returns:
    The Adm3Code for this Feature

### setAdm3Code

    public void setAdm3Code(java.lang.String adm3Code)

  Parameters:
    `adm3Code` - the adm3code to set
  See Also:
    `getAdm3Code()`

### getAdm4Code

    public java.lang.String getAdm4Code()

  Returns the Adm4Code for this feature. The only goal to have the Adm4Code directly in the GisFeature is for performance reason :
  It allows to have the adm4Code without loading the all Adm tree. See Important Notes for admXcode for `GisFeature`

  Returns:
    The Adm4Code for this Feature

### setAdm4Code

    public void setAdm4Code(java.lang.String adm4Code)

  Parameters:
    `adm4Code` - the adm4code to set
  See Also:
    `getAdm4Code()`

### getAdm1Name

    public java.lang.String getAdm1Name()

  Returns the name of the Adm of level 1 that this GisFeature is linked to. The only goal to have it directly in the gisFeature is for performance reason :
  It allows to have it without loading all the Adm tree

  Returns:
    The name of the Adm of level 1 that this GisFeature is linked to

### setAdm1Name

    public void setAdm1Name(java.lang.String adm1Name)

  Set the name of the Adm of level 1 that this GisFeature is linked to

  Parameters:
    `adm1Name` - The name of the Adm of level 1 that this GisFeature is linked to
  See Also:
    `getAdm1Name()`

### getAdm2Name

    public java.lang.String getAdm2Name()

  Returns the name of the Adm of level 2 that this GisFeature is linked to. The only goal to have it directly in the gisFeature is for performance reason :
  it allow to retrieve it without loading all the Adm tree

  Returns:
    The name of the Adm of level 2 that this GisFeature is linked to

### setAdm2Name

    public void setAdm2Name(java.lang.String adm2Name)

  Set the name of the Adm of level 2 that this GisFeature is linked to

  Parameters:
    `adm2Name` - The name of the Adm of level 2 that this GisFeature is linked to
  See Also:
    `getAdm2Name()`

### getAdm3Name

    public java.lang.String getAdm3Name()

  Returns the name of the Adm of level 3 that this GisFeature is linked to. The only goal to have it directly in the gisFeature is for performance reason :
  It allows to have it without loading all the Adm tree

  Returns:
    The name of the Adm of level 3 that this GisFeature is linked to

### setAdm3Name

    public void setAdm3Name(java.lang.String adm3Name)

  Set the name of the Adm of level 3 that this GisFeature is linked to

  Parameters:
    `adm3Name` - The name of the Adm of level 3 that this GisFeature is linked to
  See Also:
    `getAdm3Name()`

### getAdm4Name

    public java.lang.String getAdm4Name()

  Returns the name of the Adm of level 4 that this GisFeature is linked to. The only goal to have it directly in the gisFeature is for performance reason :
  It allows to have it without loading all the Adm tree

  Returns:
    The name of the Adm of level 4 that this GisFeature is linked to

### setAdm4Name

    public void setAdm4Name(java.lang.String adm4Name)

  Set The name of the adm of level 4 that the GisFeature is linked to

  Parameters:
    `adm4Name` - The name of the adm of level 4 that the GisFeature is linked to
  See Also:
    `getAdm4Name()`

### getAdm

    public Adm getAdm()

  Returns:
    The Adm with the higher Level that this GisFeature is linked to (the deeper in the Adm tree). See Important Notes for admXcode for `GisFeature`

### setAdm

    public void setAdm(Adm adm)

  Parameters:
    `adm` - The Adm with the higher Level that this GisFeature is linked to (the deeper in the Adm tree).
  See Also:
    `getAdm()`

### getAlternateNames

    public java.util.List<AlternateName> getAlternateNames()

  Returns:
    A list of the `AlternateName`s for this GisFeature

### setAlternateNames

    public void setAlternateNames(java.util.List<AlternateName> alternateNames)

  Parameters:
    `alternateNames` - The `AlternateName`s for this GisFeature

### addAlternateName

    public void addAlternateName(AlternateName alternateName)

  Do a double set : add the AlternateName to the current GisFeature and set this GisFeature as the GisFeature of the specified AlternateName

  Parameters:
    `alternateName` - the alternateName to add

### addAlternateNames

    public void addAlternateNames(java.util.List<AlternateName> alternateNames)

  Do a double set : add (not replace !)the AlternateNames to the current GisFeature and for each alternatenames : set the current GisFeature as the GisFeature of the AlternateNames

  Parameters:
    `alternateNames` - The alternateNames list to add

### getAsciiName

    public java.lang.String getAsciiName()

  Returns:
    The ASCII name of the current GisFeature

### setAsciiName

    public void setAsciiName(java.lang.String asciiname)

  Parameters:
    `asciiname` - The ASCII name of the current GisFeature
  See Also:
    `getAsciiName()`

### getCountryCode

    public java.lang.String getCountryCode()

  The country code is not mandatory because gisfeature like undersea does not belongs to a country

  Returns:
    The ISO 3166 alpha-2 letter code.

### setCountryCode

    public void setCountryCode(java.lang.String countryCode)

  Parameters:
    `countryCode` - The ISO 3166 alpha-2 letter code in upper Case (it will be automatically uppercased)
  See Also:
    `getCountryCode()`

### getElevation

    public java.lang.Integer getElevation()

  Returns:
    The elevation of this gisFeature (in meters)

### setElevation

    public void setElevation(java.lang.Integer elevation)

  Parameters:
    `elevation` - The elevation of this gisFeature (in meters)
  See Also:
    `getElevation()`

### getGtopo30

    public java.lang.Integer getGtopo30()

  Returns:
    The average elevation of 30'x30' (ca 900mx900m) area in meters

### setGtopo30

    public void setGtopo30(java.lang.Integer gtopo30)

  Parameters:
    `gtopo30` - The average elevation of 30'x30' (ca 900mx900m) area to set in meters

### getName

    public java.lang.String getName()

  Returns:
    The UTF-8 name for the current GisFeature

### setName

    public void setName(java.lang.String name)

  Parameters:
    `name` - The UTF-8 name for the current GisFeature

### getPopulation

    public java.lang.Integer getPopulation()

  Returns:
    The population (how many people are in) for this GisFeature

### setPopulation

    public void setPopulation(java.lang.Integer population)

  Parameters:
    `population` - The population (how many people are in) of this GisFeature

### getSource

    public GISSource getSource()

  Returns:
    The source for the gisFeature. it tells from which files / gazetteers it has been imported

### setSource

    public void setSource(GISSource source)

  Parameters:
    `source` - The source for the gisFeature to be set

### getTimezone

    public java.lang.String getTimezone()

  Returns:
    The timeZone for This GisFeature
  See Also:
    Time zone

### setTimezone

    public void setTimezone(java.lang.String timezone)

  Parameters:
    `timezone` - The timeZone for This GisFeature
  See Also:
    `getTimezone()`

### setLocation

    public void setLocation(com.vividsolutions.jts.geom.Point location)

  Parameters:
    `location` - The location of the GisFeature (JTS point)
  See Also:
    `getLocation()`, `getLatitude()`, `getLongitude()`

### setModificationDate

    public void setModificationDate(java.util.Date modificationDate)

  Parameters:
    `modificationDate` - The Date of the Last Modification. This fields is not updated when saving or updating a GisFeature : This fields is to track change in the gazetteers, not in the Datastore. The date should match the `Constants.GIS_DATE_PATTERN`
  See Also:
    `getModificationDate()`

### setId

    public void setId(java.lang.Long id)

  Parameters:
    `id` - The Id in the datastore. You should never call this method. It is the responsability of the dataStore
  See Also:
    `getId()`

### getFeatureId

    public java.lang.Long getFeatureId()

  Returns:
    The featureId for this GisFeature. it is a 'Domain value' not a datastore one A featureId is unique and mandatory

### setFeatureId

    public void setFeatureId(java.lang.Long featureId)

  A featureId is unique and mandatory

  Parameters:
    `featureId` - The featureId for this GisFeature

### isCity

    public boolean isCity()

  Whether the feature is a city, in the sense we define it in the `FeatureClassCodeHelper` class. It does not check the Class but the feature class and the feature code

  Returns:
    true if it is a city

### isCountry

    public boolean isCountry()

  Whether the feature is a coutry, in the sense we define it in the `FeatureClassCodeHelper` class. It does not check the Class but the feature class and the feature code

  Returns:
    true if it is a country

### isAdm

    public boolean isAdm()

  Whether the feature is an Adm, in the sense we define it in the `FeatureClassCodeHelper` class. It does not check the Class but the feature class and the feature code

  Returns:
    true if it is an ADM

### getFeatureClass

    public java.lang.String getFeatureClass()

  Returns:
    The feature class for this gisFeature (should always be in uppercase because setter automatically convert the feature class in upperCase). A feature class regroup some feature code
  See Also:
    codes

### setFeatureClass

    public void setFeatureClass(java.lang.String featureClass)

  Parameters:
    `featureClass` - The feature class to set. Note The featureClass will automaticaly be uppercased.
  See Also:
    `getFeatureClass()`

### getFeatureCode

    public java.lang.String getFeatureCode()

  Returns:
    the featureCode for the current GisFeature. A feature Code represents a specific Feature type. GisGraphy regroup some featureCode in an abstract Level called 'GisType'. A GisType regroup several featurecode.
  See Also:
    `FeatureCode`

### populate

    public void populate(GisFeature gisFeature)

  Populate all the field / association of the current gisFeature with The Value of The specified One.

  Parameters:
    `gisFeature` - the gisFeature to populate with

### setFeatureCode

    public void setFeatureCode(java.lang.String featureCode)

  Parameters:
    `featureCode` - The feature Code for this GisFeature * Note The featureCode will automaticaly be uppercased
  See Also:
    `getFeatureCode()`

### isFullTextSearchable

    public boolean isFullTextSearchable()

  Returns:
    true If the gisFeature must be sync with the fullText search engine

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `java.lang.Object`

### equals

    public boolean equals(java.lang.Object obj)

  Overrides:
    `equals` in class `java.lang.Object`

### getFullyQualifiedName

    public 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)

  Parameters:
    `withCountry` - Whether the country information should be added
  Returns:
    a name with the Administrative division and Country

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2009. All Rights Reserved.