0

I would like to create features from a MultiLineStringM Geometry in Openlayers. Is that possible and, if yes, how?

The difference to a normal MultiLineString is that in a MultiLinestringM I have three values: 2 for coordinates and 1 for the meter.

The MultiLineStringM looks like this for example:

"MULTILINESTRINGM((
362854.5718999998 5691741.437899999 0,
362854.2510000001 5691741.3878 0.324773999995159,
362852.5449999999 5691741.1215 2.051373999995121,
362851.6495000003 5691740.957499999 2.961773999995785,
362849.2790999999 5691740.3333 5.412973999995302,
362849.1430000001 5691740.297499999 5.553773999996338,
362844.1265000002 5691737.835 11.14207399999577))"

I tried to read the Geometry with the WKT API like this:

const format = new WKT();
let geom = format.readGeometry(<String like shown above>);

But got this error: Error: Invalid geometry type: MULTILINESTRINGM

Athshe
  • 69
  • 8
  • 1
    The correct syntax needs a space between MULTILINESTRING and M – Mike Mar 30 '23 at 15:14
  • @Mike Thanks very much, that's it! Do you want to post this as a answer to my question, so I can mark it as accepted? – Athshe Mar 31 '23 at 06:32

1 Answers1

1

The correct syntax is

"MULTILINESTRING M((
362854.5718999998 5691741.437899999 0,
362854.2510000001 5691741.3878 0.324773999995159,
362852.5449999999 5691741.1215 2.051373999995121,
362851.6495000003 5691740.957499999 2.961773999995785,
362849.2790999999 5691740.3333 5.412973999995302,
362849.1430000001 5691740.297499999 5.553773999996338,
362844.1265000002 5691737.835 11.14207399999577))"
Mike
  • 16,042
  • 2
  • 14
  • 30