4D Data in GeoJson in PostGIS











up vote
0
down vote

favorite












I'm trying to store 4-D data ("LINGSTRING ZM") in Postgres/PostGIS, and it seems that GeoJson loses 4-D data:



select ST_AsText(ST_GeomFromGeoJSON('{"type":"LineString","coordinates":[[1,2,3,4],[4,5,6,7],[7,8,9,9]]}'))



Yields: "LINESTRING Z (1 2 4.65371818235691e-310,4 5 4.65371818235691e-310,7 8 4.65371818235691e-310)". And If I'm going WKT all the way, it works just fine.



Is this a problem with GeoJson definition? With PostGIS support of GeoJson?



Versions:
"POSTGIS="2.1.2 r12389" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.10.1, released 2013/08/26" LIBXML="2.9.1" LIBJSON="UNKNOWN" RASTER"



"PostgreSQL 9.3.24 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4, 64-bit"










share|improve this question


















  • 1




    Read the second comment on this question. According to RFC 7946 “Implementations SHOULD NOT extend positions beyond three elements because the semantics of extra elements are unspecified and ambiguous. Historically, some implementations have used a fourth element to carry a linear referencing measure (sometimes denoted as "M") or a numerical timestamp (...) additional elements MAY be ignored by parsers.”
    – thibautg
    Nov 22 at 8:26

















up vote
0
down vote

favorite












I'm trying to store 4-D data ("LINGSTRING ZM") in Postgres/PostGIS, and it seems that GeoJson loses 4-D data:



select ST_AsText(ST_GeomFromGeoJSON('{"type":"LineString","coordinates":[[1,2,3,4],[4,5,6,7],[7,8,9,9]]}'))



Yields: "LINESTRING Z (1 2 4.65371818235691e-310,4 5 4.65371818235691e-310,7 8 4.65371818235691e-310)". And If I'm going WKT all the way, it works just fine.



Is this a problem with GeoJson definition? With PostGIS support of GeoJson?



Versions:
"POSTGIS="2.1.2 r12389" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.10.1, released 2013/08/26" LIBXML="2.9.1" LIBJSON="UNKNOWN" RASTER"



"PostgreSQL 9.3.24 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4, 64-bit"










share|improve this question


















  • 1




    Read the second comment on this question. According to RFC 7946 “Implementations SHOULD NOT extend positions beyond three elements because the semantics of extra elements are unspecified and ambiguous. Historically, some implementations have used a fourth element to carry a linear referencing measure (sometimes denoted as "M") or a numerical timestamp (...) additional elements MAY be ignored by parsers.”
    – thibautg
    Nov 22 at 8:26















up vote
0
down vote

favorite









up vote
0
down vote

favorite











I'm trying to store 4-D data ("LINGSTRING ZM") in Postgres/PostGIS, and it seems that GeoJson loses 4-D data:



select ST_AsText(ST_GeomFromGeoJSON('{"type":"LineString","coordinates":[[1,2,3,4],[4,5,6,7],[7,8,9,9]]}'))



Yields: "LINESTRING Z (1 2 4.65371818235691e-310,4 5 4.65371818235691e-310,7 8 4.65371818235691e-310)". And If I'm going WKT all the way, it works just fine.



Is this a problem with GeoJson definition? With PostGIS support of GeoJson?



Versions:
"POSTGIS="2.1.2 r12389" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.10.1, released 2013/08/26" LIBXML="2.9.1" LIBJSON="UNKNOWN" RASTER"



"PostgreSQL 9.3.24 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4, 64-bit"










share|improve this question













I'm trying to store 4-D data ("LINGSTRING ZM") in Postgres/PostGIS, and it seems that GeoJson loses 4-D data:



select ST_AsText(ST_GeomFromGeoJSON('{"type":"LineString","coordinates":[[1,2,3,4],[4,5,6,7],[7,8,9,9]]}'))



Yields: "LINESTRING Z (1 2 4.65371818235691e-310,4 5 4.65371818235691e-310,7 8 4.65371818235691e-310)". And If I'm going WKT all the way, it works just fine.



Is this a problem with GeoJson definition? With PostGIS support of GeoJson?



Versions:
"POSTGIS="2.1.2 r12389" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.10.1, released 2013/08/26" LIBXML="2.9.1" LIBJSON="UNKNOWN" RASTER"



"PostgreSQL 9.3.24 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4, 64-bit"







postgis geojson 4d






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 20 at 8:36









Ronen

17611




17611








  • 1




    Read the second comment on this question. According to RFC 7946 “Implementations SHOULD NOT extend positions beyond three elements because the semantics of extra elements are unspecified and ambiguous. Historically, some implementations have used a fourth element to carry a linear referencing measure (sometimes denoted as "M") or a numerical timestamp (...) additional elements MAY be ignored by parsers.”
    – thibautg
    Nov 22 at 8:26
















  • 1




    Read the second comment on this question. According to RFC 7946 “Implementations SHOULD NOT extend positions beyond three elements because the semantics of extra elements are unspecified and ambiguous. Historically, some implementations have used a fourth element to carry a linear referencing measure (sometimes denoted as "M") or a numerical timestamp (...) additional elements MAY be ignored by parsers.”
    – thibautg
    Nov 22 at 8:26










1




1




Read the second comment on this question. According to RFC 7946 “Implementations SHOULD NOT extend positions beyond three elements because the semantics of extra elements are unspecified and ambiguous. Historically, some implementations have used a fourth element to carry a linear referencing measure (sometimes denoted as "M") or a numerical timestamp (...) additional elements MAY be ignored by parsers.”
– thibautg
Nov 22 at 8:26






Read the second comment on this question. According to RFC 7946 “Implementations SHOULD NOT extend positions beyond three elements because the semantics of extra elements are unspecified and ambiguous. Historically, some implementations have used a fourth element to carry a linear referencing measure (sometimes denoted as "M") or a numerical timestamp (...) additional elements MAY be ignored by parsers.”
– thibautg
Nov 22 at 8:26



















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53389045%2f4d-data-in-geojson-in-postgis%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53389045%2f4d-data-in-geojson-in-postgis%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

404 Error Contact Form 7 ajax form submitting

How to know if a Active Directory user can login interactively

TypeError: fit_transform() missing 1 required positional argument: 'X'