Im trying to store an "empty" feature using openlayers (version >= 3) like this one :
let defaultFeature = new ol.Feature({
geometry: new ol.geom.MultiLineString([]),
});
As you can see, it's just an empty multilinestring waiting to be filled with lines.
I have a database table built like this :
CREATE TABLE md (
id SERIAL PRIMARY KEY NOT NULL,
name varchar(40) NOT NULL,
geometry geometry(MULTILINESTRING, 3857)
);
then i send the feature to tinyows for storage, (here the payload)
<Transaction
xmlns="http://www.opengis.net/wfs" service="WFS" version="1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
<Insert>
<md
xmlns="http://www.tinyows.org/">
<geometry>
<MultiLineString
xmlns="http://www.opengis.net/gml" srsName="EPSG:3857"/>
</geometry>
</md>
</Insert>
</Transaction>
but the database returns an error :
Geometry has Z dimension but column does not
After getting that error i tried to use the parameter "opt_layout" (http://openlayers.org/en/latest/apidoc/module-ol_geom_MultiLineString-MultiLineString.html) like this :
let defaultMdFeature = new ol.Feature({
geometry: new ol.geom.MultiLineString([], 'XY'),
});
and the payload :
<Transaction
xmlns="http://www.opengis.net/wfs" service="WFS" version="1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
<Insert>
<md
xmlns="http://www.tinyows.org/">
<geometry>
<MultiLineString
xmlns="http://www.opengis.net/gml" srsName="EPSG:3857"/>
</geometry>
</md>
</Insert>
</Transaction>
Sadly, i get the same error even by specifying the layout.
My question is : is there a way to store an empty 2d multilinestring into postgis ?
thank you in advance for your support,
G.R.