[Please keep discussions on the mailing list] Octavian,
first you will need to obtain such a data set and publish it as a feature type (layer). As this is a GeoServer list, we will naturally recommend GeoServer. One such data set is GADM: http://www.gadm.org/ http://www.gadm.org/version2 https://en.wikipedia.org/wiki/GADM "This dataset is freely available for academic use and other non-commercial use. Redistribution, or commercial use is not allowed without prior permission." You should be able to use GDAL to convert the GDB data to a format supported by GeoServer (shapefiles, postgis). I have not tried this. Please let us know if it works. Kind regards, Ben. On 03/11/15 21:07, Octavian Machidon wrote: > Hello Ben, > > Thanks for your reply. > I managed based on the GeoServer demos to make a request script that gives > me what I want: > > <wfs:GetFeature service="WFS" version="1.0.0" outputFormat="JSON" > xmlns:topp="http://www.openplans.org/topp" xmlns:wfs=" > http://www.opengis.net/wfs" xmlns="http://www.opengis.net/ogc" xmlns:gml=" > http://www.opengis.net/gml" xmlns:xsi=" > http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" > http://www.opengis.net/wfs > http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd"> > <wfs:Query typeName="topp:states"> > <Filter> > <Intersects> > <PropertyName>the_geom</PropertyName> > <gml:Polygon srsName=" > http://www.opengis.net/gml/srs/epsg.xml#4326"> > <gml:outerBoundaryIs> > <gml:LinearRing> > > <gml:coordinates>-102.7001953125,42.24803865129935 > -116.1474609375,37.94766320181289 -97.6904296875,29.098417261875596 > -102.7001953125,42.24803865129935</gml:coordinates> > </gml:LinearRing> > </gml:outerBoundaryIs> > </gml:Polygon> > </Intersects> > </Filter> > </wfs:Query> > </wfs:GetFeature> > > The thing is, the above code returns a reply containing all the states > intersected by that polygon. > I am also interested however in getting smaller administrative regions, > like provinces for example, or even cities. > Do you know how this could be achieved? > > Thank you and best regards, > Octavian > > On Mon, Oct 26, 2015 at 9:37 PM, Ben Caradoc-Davies <[email protected]> > wrote: > >> Octavian, >> >> this looks to me like a WFS filter query, perhaps one that could be >> implemented with the Intersects operator. Do you want areas that have some >> part inside your geometry (Intersects) or complete containment >> (Conatains/Within)? >> >> See the WFS_getFeatureIntersects-1.1.xml in the GeoServer demo requests >> and B.3.16 Example 16 in the WFS 2.0.2 standard: >> http://docs.opengeospatial.org/is/09-025r2/09-025r2.html#331 >> >> To use XML WFS requests from JavaScript, you will need to satisfy the >> JavaScript origin rules for XML requests; you will need a GeoServer >> instance that appears to clients to be on the same server as your Google >> Map (either installed there or with a reverse proxy). Client JavaScript >> makes WFS filter query to get XML. The GeoServer instance connects to your >> data store, which contains a layer of all the administrative areas, one >> feature per area, at all granularities (so they overlap). >> >> Your Google Map will likely be in EPSG:3857. GeoServer will perform all >> reprojections to convert between this coordinate reference system and that >> of your data. >> >> For WMS mapping you could use a property that is filtered based on the >> scale of the map to prevent overlap. >> >> Kind regards, >> Ben. >> >> >> On 27/10/15 03:17, Octavian Machidon wrote: >> >>> Hello, >>> >>> I working on a Web app and I need some Geolocation functionality. >>> I am new to Geoserver, and would like to ask for some help/hints to put me >>> on the right track. >>> Here's the deal: >>> Based on a polygon selection on a Google Map, I need to retrieve the list >>> of administrative areas in that polygon area (countries + states + >>> counties). The database must consist of all administrative areas in the US >>> and as many as possible in the rest of the world (down to >>> regions/states/provinces). >>> >>> Any hints are greatly appreciated. >>> >>> Thanks. >>> >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> >>> >>> >>> _______________________________________________ >>> Geoserver-users mailing list >>> [email protected] >>> https://lists.sourceforge.net/lists/listinfo/geoserver-users >>> >>> >> -- >> Ben Caradoc-Davies <[email protected]> >> Director >> Transient Software Limited <http://transient.nz/> >> New Zealand >> > -- Ben Caradoc-Davies <[email protected]> Director Transient Software Limited <http://transient.nz/> New Zealand ------------------------------------------------------------------------------ _______________________________________________ Geoserver-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users
