7

Why does GeoServer (v2.5.1) WFS layer (see red line/layer below) not overlay features of source PostGIS table or related WMS layer in QGIS (tested in v2.6 and 2.12)? All layers are defined in the same GCS (EPSG: 4326) (interstate Tiger shp data originally obtained from US Census site), see image below:

enter image description here

I've un-checked the QGIS option/setting "Enable feature simplification....". I'm guessing this may be a server side configuration for WFS/GML, or I fear a limitation with GCS served data as WFS.

Here is the store xml:

<dataStore>
  <id>DataStoreInfoImpl-xyz</id>
  <name>General</name>
  <type>PostGIS</type>
  <enabled>true</enabled>
  <workspace>
    <id>WorkspaceInfoImpl--xyz</id>
  </workspace>
  <connectionParameters>
    <entry key="port">thePort</entry>
    <entry key="Connection timeout">20</entry>
    <entry key="passwd">xyz</entry>
    <entry key="dbtype">postgis</entry>
    <entry key="encode functions">false</entry>
    <entry key="namespace">theName</entry>
    <entry key="schema">public</entry>
    <entry key="create database">false</entry>
    <entry key="fetch size">10000</entry>
    <entry key="preparedStatements">false</entry>
    <entry key="min connections">1</entry>
    <entry key="host">localhost</entry>
    <entry key="validate connections">true</entry>
    <entry key="max connections">20</entry>
    <entry key="Support on the fly geometry simplification">false</entry>
    <entry key="database">theDB</entry>
    <entry key="Loose bbox">true</entry>
    <entry key="Expose primary keys">false</entry>
    <entry key="Max open prepared statements">50</entry>
    <entry key="Estimated extends">true</entry>
    <entry key="user">theUser</entry>
  </connectionParameters>
  <__default>false</__default>
</dataStore>

Here is the featuretype xml:

<featureType>
  <id>FeatureTypeInfoImpl-xyz</id>
  <name>layerName</name>
  <nativeName>layerName</nativeName>
  <namespace>
    <id>NamespaceInfoImpl--xyz</id>
  </namespace>
  <title>layerName</title>
  <keywords>
    <string>features</string>
    <string>layerName</string>
  </keywords>
  <nativeCRS>GEOGCS[&quot;WGS 84&quot;, &#xd;
  DATUM[&quot;World Geodetic System 1984&quot;, &#xd;
    SPHEROID[&quot;WGS 84&quot;, 6378137.0, 298.257223563, AUTHORITY[&quot;EPSG&quot;,&quot;7030&quot;]], &#xd;
    AUTHORITY[&quot;EPSG&quot;,&quot;6326&quot;]], &#xd;
  PRIMEM[&quot;Greenwich&quot;, 0.0, AUTHORITY[&quot;EPSG&quot;,&quot;8901&quot;]], &#xd;
  UNIT[&quot;degree&quot;, 0.017453292519943295], &#xd;
  AXIS[&quot;Geodetic longitude&quot;, EAST], &#xd;
  AXIS[&quot;Geodetic latitude&quot;, NORTH], &#xd;
  AUTHORITY[&quot;EPSG&quot;,&quot;4326&quot;]]</nativeCRS>
  <srs>EPSG:4326</srs>
  <nativeBoundingBox>
    <minx>-123.393768310547</minx>
    <maxx>-67.7812576293945</maxx>
    <miny>25.7490768432617</miny>
    <maxy>49.0023765563965</maxy>
    <crs>EPSG:4326</crs>
  </nativeBoundingBox>
  <latLonBoundingBox>
    <minx>-123.393768310547</minx>
    <maxx>-67.7812576293945</maxx>
    <miny>25.7490768432617</miny>
    <maxy>49.0023765563965</maxy>
    <crs>GEOGCS[&quot;WGS84(DD)&quot;, &#xd;
  DATUM[&quot;WGS84&quot;, &#xd;
    SPHEROID[&quot;WGS84&quot;, 6378137.0, 298.257223563]], &#xd;
  PRIMEM[&quot;Greenwich&quot;, 0.0], &#xd;
  UNIT[&quot;degree&quot;, 0.017453292519943295], &#xd;
  AXIS[&quot;Geodetic longitude&quot;, EAST], &#xd;
  AXIS[&quot;Geodetic latitude&quot;, NORTH]]</crs>
  </latLonBoundingBox>
  <projectionPolicy>FORCE_DECLARED</projectionPolicy>
  <enabled>true</enabled>
  <metadata>
    <entry key="cachingEnabled">false</entry>
  </metadata>
  <store class="dataStore">
    <id>DataStoreInfoImpl-xyz</id>
  </store>
  <maxFeatures>0</maxFeatures>
  <numDecimals>0</numDecimals>
</featureType>
  • Can you be more precise about the layers? Are the WMS layer and WFS layer just pointing to different services of the same GeoServer layer? Can you show the GeoServer data store and layer configuration (just from the XML is probably easier)? – BradHards Jan 4 '16 at 20:15
  • The store and layer source are the same for both WMS and WFS layer examples. I've compared WMS and WFS from source PostGIS in PCS and it overlays correctly. I suspect an issue with GCS data being served out as WFS that the geometry gets messy. – artwork21 Jan 4 '16 at 20:23
  • Can you please show the configuration and some sample data? – BradHards Jan 4 '16 at 20:26
  • 1
    Indeed, what is the metric difference between the two lines? Meters? Millimeters? And what is the CRS of the data itself? – Andrea Aime Jan 5 '16 at 7:23
  • 1
    Since the WMS and WFS are coming from the same server, it's unlikely the SQL being generated for PostGIS differs, but using log_statement in PgSQL to example the SQL is always a good idea. My guess is that the GML writer is truncating some precision from the coordinates. Examine the GML being generated, does it stop at 4 or 5 digits, or go deeper? – Paul Ramsey Jan 5 '16 at 14:46
5

The output would seem consistent with a decimal truncation, which is performed by GeoServer WFS 1.0 as configured in the global panel. Normally the value would be 8 decimals, but your precision issues seem to suggest a setting like 5 decimals instead (making the rough assumption of 100km per decimal degree, in practice that changes a lot depending on the latitude, see https://en.wikipedia.org/wiki/Latitude#Length_of_a_degree_of_latitude )

2

It's defintely related to the resolution somehow. I wouldn't know if the lower resolution is enforced by GeoServer or QGIS as I don't know these tools.

Take a look at the image below where I have added a sort of grid line layer on top of the map. Can you see how the distance between the black lines is similar horisontal and vertical?

I have only added lines where there seemed to be a node in the red line layer so in some areas the distance is doubled between the grids lines.

So the question is now where can you specify a lower resolution (precision truncation) or simplification of your data that would return a result like this?

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.