Code Monkey home page Code Monkey logo

Comments (6)

jacklinna avatar jacklinna commented on May 26, 2024

what is your WFS server?put its parameters on;

from openlayers.

msch-alpgis avatar msch-alpgis commented on May 26, 2024

In my example the response was from the MapServer. But I can produce the same behaviour with the GeoServer. It doesn't seem to have a relation with the WFS server or the WFS version. After parsing a response with the ol format WFS I always get geometries with a faked Z dimension with value 0.

from openlayers.

mprins avatar mprins commented on May 26, 2024

I don't know the reasoning, but the GML2 parser always produces a z value for a coordinate see:

for (let i = 0, ii = coordsGroups.length; i < ii; i++) {
const coords = coordsGroups[i].split(/,+/);
const x = parseFloat(coords[0]);
const y = parseFloat(coords[1]);
const z = coords.length === 3 ? parseFloat(coords[2]) : 0;
if (axisOrientation.substr(0, 2) === 'en') {
flatCoordinates.push(x, y, z);
} else {
flatCoordinates.push(y, x, z);
}

from openlayers.

ahocevar avatar ahocevar commented on May 26, 2024

See #6620 for an explanation. I don't know if what's written there is true though, so if anyone has an idea for a fix, a pull request would be welcome.

from openlayers.

jacklinna avatar jacklinna commented on May 26, 2024

I don't know the reasoning, but the GML2 parser always produces a z value for a coordinate see:

for (let i = 0, ii = coordsGroups.length; i < ii; i++) {
const coords = coordsGroups[i].split(/,+/);
const x = parseFloat(coords[0]);
const y = parseFloat(coords[1]);
const z = coords.length === 3 ? parseFloat(coords[2]) : 0;
if (axisOrientation.substr(0, 2) === 'en') {
flatCoordinates.push(x, y, z);
} else {
flatCoordinates.push(y, x, z);
}

I think the format of (x,y) is diffrent of (x,y,0);the first is 2d,another is 3d;z=0 does not mean 2d;so fix it just add push(x,y) case;

from openlayers.

ahocevar avatar ahocevar commented on May 26, 2024

@jacklinna I think that makes sense. Would you be able to create a pull request?

from openlayers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.