Сервис WFS
Метод: GET http://maps.kosmosnimki.ru/rest/ver1/service/wfs
Реализация протокола WFS для получение информации о геообъектах векторных слойв. Протокол совместим с множеством стандартных ГИС.
Данный стандарт был разработан международной организацией OGC.
Стандарт позволяет получать:
- записи из векторного слоя в формате OGC(XML). Координаты и атрибуты объектов.
- описание карты и состав слоёв в формате XML
Параметры запроса
apikey (тип: string )
Для получения ключа воспользуйтесь личным кабинетом.
SERVICE (тип: string , обязательный параметр)
MAP (тип: string , обязательный параметр)
VERSION (тип: string )
REQUEST (тип: string , обязательный параметр)
- GetCapabilities — Описание карты, состав слоёв и их ID в формате XML.
- DescribeFeatureType — Описание слоя. Список колонок и их типов.
- GetFeature — Получение записей слоя.
SRSNAME (тип: string )
SRSNAME=namespace:identifier. Поддерживаются 3 проекции:
EPSG:3395 — проекция Меркатора
EPSG:3857 — проекция сферический Меркатор
EPSG:4326 — проекция WGS84 (долгота/широта)
По умолчанию используется EPSG:4326.
Пример: SRSNAME=EPSG:4326
BBOX (тип: string )
Формат: BBOX=minx,miny,maxx,maxy
Для проекции EPSG:4326 формат другой BBOX=minLatitude,minLongitude,maxLatitude,maxLongitude
Пример:
TypeName (тип: )
Идентификаторы слоя получаются из запроса REQUEST=GetCapabilities или можно указать ID слоя в Геомиксере.
Пример: TYPENAME=LC13B4D9706F7491EBC6DC70DFFA988C0
FORMAT (тип: string )
- image/jpeg (или jpeg, jpg)
- image/png (или png)
Значение по умолчанию jpeg.
MaxFeatures (тип: number )
FILTER (тип: string )
Пример запроса:
FILTER=<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml">
<ogc:And>
<ogc:BBOX>
<ogc:PropertyName>wkb_geometry</ogc:PropertyName>
<gml:Box srsName="EPSG:4326">
<gml:coordinates cs="," ts=" ">63,39 110,72</gml:coordinates>
</gml:Box>
</ogc:BBOX>
<ogc:PropertyIsGreaterThan>
<ogc:PropertyName>DateTime</ogc:PropertyName>
<ogc:Literal>2014-06-06</ogc:Literal>
</ogc:PropertyIsGreaterThan>
</ogc:And>
</ogc:Filter>
WHERE (тип: string )
Пример условия WHERE="ColumnName"='string constant'
Примеры ответов сервера
Запрос
http://maps.kosmosnimki.ru/rest/ver1/service/wfs?&apikey=81Z2S9A248
&map=0D9E8EDC688E49C181F7C3E58169EBC7
&SERVICE=WFS
&REQUEST=GetCapabilities
&VERSION=1.0.0
&TYPENAME=C13B4D9706F7491EBC6DC70DFFA988C0
Ответ.
Статус: 200
<?xml version="1.0" encoding="UTF-8"?>
<WFS_Capabilities xmlns="http://www.opengis.net/wfs" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-capabilities.xsd">
<Service>
<Name>Geomixer WFS</Name>
<Title>wfs test</Title>
<OnlineResource>http://maps.kosmosnimki.ru/rest/ver1/service/wfs/apikey81Z2S9A248/map0D9E8EDC688E49C181F7C3E58169EBC7?</OnlineResource>
<Fees>NONE</Fees>
<AccessConstraints>NONE</AccessConstraints>
</Service>
<Capability>
<Request>
<GetCapabilities>
<DCPType>
<HTTP>
<Get onlineResource="http://maps.kosmosnimki.ru/rest/ver1/service/wfs/apikey81Z2S9A248/map0D9E8EDC688E49C181F7C3E58169EBC7?" />
</HTTP>
</DCPType>
</GetCapabilities>
<DescribeFeatureType>
<DCPType>
<HTTP>
<Get onlineResource="http://maps.kosmosnimki.ru/rest/ver1/service/wfs/apikey81Z2S9A248/map0D9E8EDC688E49C181F7C3E58169EBC7?" />
</HTTP>
</DCPType>
<DCPType>
<HTTP>
<Post onlineResource="http://maps.kosmosnimki.ru/rest/ver1/service/wfs/apikey81Z2S9A248/map0D9E8EDC688E49C181F7C3E58169EBC7?" />
</HTTP>
</DCPType>
</DescribeFeatureType>
<GetFeature>
<ResultFormat>
<GML2 />
<GML3 />
</ResultFormat>
<DCPType>
<HTTP>
<Get onlineResource="http://maps.kosmosnimki.ru/rest/ver1/service/wfs/apikey81Z2S9A248/map0D9E8EDC688E49C181F7C3E58169EBC7?" />
</HTTP>
</DCPType>
<DCPType>
<HTTP>
<Post onlineResource="http://maps.kosmosnimki.ru/rest/ver1/service/wfs/apikey81Z2S9A248/map0D9E8EDC688E49C181F7C3E58169EBC7?" />
</HTTP>
</DCPType>
</GetFeature>
</Request>
</Capability>
<FeatureTypeList>
<Operations>
<Query />
</Operations>
<FeatureType>
<Name>gmx:L9CE7DF28B34841B3B7F04D209FCB6FC6</Name>
<Title>АТД3_субъекты</Title>
<Abstract>по данным OSM</Abstract>
<SRS>EPSG:4326</SRS>
<SRS>EPSG:3395</SRS>
<SRS>EPSG:3857</SRS>
<LatLongBoundingBox minx="-180" miny="41.1858708058188" maxx="180" maxy="81.858720230541" />
</FeatureType>
<FeatureType>
<Name>gmx:L3E88643A8AC94AFAB4FD44941220B1CE</Name>
<Title>[FireService].[ClusterPerDayGlobal]</Title>
<Abstract />
<SRS>EPSG:4326</SRS>
<SRS>EPSG:3395</SRS>
<SRS>EPSG:3857</SRS>
<LatLongBoundingBox minx="-175.391999781132" miny="-59.0158999152684" maxx="179.607000052929" maxy="71.700300098929" />
</FeatureType>
<FeatureType>
<Name>gmx:LC13B4D9706F7491EBC6DC70DFFA988C0</Name>
<Title>World</Title>
<Abstract />
<SRS>EPSG:4326</SRS>
<SRS>EPSG:3395</SRS>
<SRS>EPSG:3857</SRS>
<LatLongBoundingBox minx="-179.99900020659" miny="-85.7899000050361" maxx="179.915999919176" maxy="74.9818999457024" />
</FeatureType>
<FeatureType>
<Name>gmx:LE58063D97D534BB4BBDFF07FE5CB17F2</Name>
<Title>[FireService].[ClustersPerDayScanex]</Title>
<Abstract />
<SRS>EPSG:4326</SRS>
<SRS>EPSG:3395</SRS>
<SRS>EPSG:3857</SRS>
<LatLongBoundingBox minx="-162.525999695063" miny="23.2544997545239" maxx="173.31000007689" maxy="73.4347000819143" />
</FeatureType>
<FeatureType>
<Name>gmx:LF2840D287CD943C4B1122882C5B92565</Name>
<Title>Russia</Title>
<Abstract />
<SRS>EPSG:4326</SRS>
<SRS>EPSG:3395</SRS>
<SRS>EPSG:3857</SRS>
<LatLongBoundingBox minx="-163.01499992609" miny="22.0498000255767" maxx="175.865999758244" maxy="75.2266999693233" />
</FeatureType>
</FeatureTypeList>
<ogc:Filter_Capabilities>
<ogc:Spatial_Capabilities>
<ogc:Spatial_Operators>
<ogc:BBOX />
<ogc:Intersect />
<ogc:Within />
<ogc:Contains />
</ogc:Spatial_Operators>
</ogc:Spatial_Capabilities>
<ogc:Scalar_Capabilities>
<ogc:Logical_Operators />
<ogc:Comparison_Operators>
<ogc:Simple_Comparisons />
<ogc:NullCheck />
</ogc:Comparison_Operators>
<ogc:Arithmetic_Operators>
<ogc:Simple_Arithmetic />
</ogc:Arithmetic_Operators>
</ogc:Scalar_Capabilities>
</ogc:Filter_Capabilities>
</WFS_Capabilities>
Запрос
http://maps.kosmosnimki.ru/rest/ver1/service/wfs?&apikey=81Z2S9A248
&map=0D9E8EDC688E49C181F7C3E58169EBC7
&SERVICE=WFS
&REQUEST=DescribeFeatureType
&VERSION=1.0.0
&TYPENAME=C13B4D9706F7491EBC6DC70DFFA988C0
Ответ.
Статус: 200
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified" targetNamespace="http://www.opengeospatial.net/cite">
<xsd:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd" />
<xsd:complexType name="LC13B4D9706F7491EBC6DC70DFFA988C0Type">
<xsd:complexContent>
<xsd:extension base="gml:AbstractFeatureType">
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="0" name="wkb_geometry" nillable="true" type="gml:GeometryPropertyType" />
<xsd:element maxOccurs="1" minOccurs="0" name="SpotID" nillable="true" type="int" />
<xsd:element maxOccurs="1" minOccurs="0" name="FileName" nillable="true" type="string" />
<xsd:element maxOccurs="1" minOccurs="0" name="Confidence" nillable="true" type="int" />
<xsd:element maxOccurs="1" minOccurs="0" name="Timestamp" nillable="true" type="dateTime" />
<xsd:element maxOccurs="1" minOccurs="0" name="ClusterID" nillable="true" type="int" />
<xsd:element maxOccurs="1" minOccurs="0" name="IndustrialClusterID" nillable="true" type="int" />
<xsd:element maxOccurs="1" minOccurs="0" name="IndustrialFireStatus" nillable="true" type="int" />
<xsd:element maxOccurs="1" minOccurs="0" name="FireType" nillable="true" type="int" />
<xsd:element maxOccurs="1" minOccurs="0" name="Platform" nillable="true" type="string" />
<xsd:element maxOccurs="1" minOccurs="0" name="Source" nillable="true" type="string" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="LC13B4D9706F7491EBC6DC70DFFA988C0" substitutionGroup="gml:_Feature" type="gmx:LC13B4D9706F7491EBC6DC70DFFA988C0Type" />
</xsd:schema>
Запрос
http://maps.kosmosnimki.ru/rest/ver1/service/wfs?&apikey=81Z2S9A248
&map=0D9E8EDC688E49C181F7C3E58169EBC7
&SERVICE=WFS
&REQUEST=GetFeature
&VERSION=1.0.0
&TYPENAME=C13B4D9706F7491EBC6DC70DFFA988C0
&maxFeatures=2
&FILTER=<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml"><ogc:And><ogc:PropertyIsGreaterThan><ogc:PropertyName>Timestamp</ogc:PropertyName><ogc:Literal>2014-06-06T00:00:00Z</ogc:Literal></ogc:PropertyIsGreaterThan><ogc:PropertyIsLessThan><ogc:PropertyName>Timestamp</ogc:PropertyName><ogc:Literal>2017-06-07T00:00:00Z</ogc:Literal></ogc:PropertyIsLessThan></ogc:And></ogc:Filter>
Ответ.
Статус: 200
<?xml version="1.0" encoding="UTF-8"?>
<wfs:FeatureCollection xmlns:wfs="http://www.opengis.net/wfs" xmlns="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:gmx="http://www.opengis.net/wfs" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<wfs:member>
<gmx:LC13B4D9706F7491EBC6DC70DFFA988C0 fid="LC13B4D9706F7491EBC6DC70DFFA988C0.18541468">
<gmx:wkb_geometry>
<gml:Point srsName="EPSG:4326">
<gml:coordinates>-37.5222,-4.93251</gml:coordinates>
</gml:Point>
</gmx:wkb_geometry>
<gmx:SpotID>18541468</gmx:SpotID>
<gmx:FileName>MOD14.A2014157.0105.005.NRT.hdf</gmx:FileName>
<gmx:Confidence>7</gmx:Confidence>
<gmx:Timestamp>2014-06-06T01:05:00</gmx:Timestamp>
<gmx:ClusterID>null</gmx:ClusterID>
<gmx:IndustrialClusterID>null</gmx:IndustrialClusterID>
<gmx:IndustrialFireStatus>null</gmx:IndustrialFireStatus>
<gmx:FireType>0</gmx:FireType>
<gmx:Platform>TERRA</gmx:Platform>
<gmx:Source>NASA</gmx:Source>
</gmx:LC13B4D9706F7491EBC6DC70DFFA988C0>
</wfs:member>
<wfs:member>
<gmx:LC13B4D9706F7491EBC6DC70DFFA988C0 fid="LC13B4D9706F7491EBC6DC70DFFA988C0.18541469">
<gmx:wkb_geometry>
<gml:Point srsName="EPSG:4326">
<gml:coordinates>-40.2114,-2.91323</gml:coordinates>
</gml:Point>
</gmx:wkb_geometry>
<gmx:SpotID>18541469</gmx:SpotID>
<gmx:FileName>MOD14.A2014157.0105.005.NRT.hdf</gmx:FileName>
<gmx:Confidence>8</gmx:Confidence>
<gmx:Timestamp>2014-06-06T01:05:00</gmx:Timestamp>
<gmx:ClusterID>null</gmx:ClusterID>
<gmx:IndustrialClusterID>null</gmx:IndustrialClusterID>
<gmx:IndustrialFireStatus>null</gmx:IndustrialFireStatus>
<gmx:FireType>0</gmx:FireType>
<gmx:Platform>TERRA</gmx:Platform>
<gmx:Source>NASA</gmx:Source>
</gmx:LC13B4D9706F7491EBC6DC70DFFA988C0>
</wfs:member>
</wfs:FeatureCollection>
