none
Problem with geometry types & LINESTRING's with many coordinates RRS feed

  • Question

  • Hi,

    I have a working method for inserting Geometry types of type LINESTRING (using the WKT format) into a MSSQL server table, as long as the number of elements in the LINESTRING does not exceed a certain number. In witch case it will insert the row into the database but leave the geometry type empty.
    I can see that the format of the WKT is correct. I can even copy the string from the debugger and insert it into the database using "normal" SQL syntax.

    I do not get any error msg or exception that I can see, it is as if EntityFramework removes the geometry and sets it to empty before adding it to the database.

    Is there a limitation in Entity Framework of how many coordinates that you can have in LINESTRING?
    (One example of a line that fails to be inserted contains 260 coordinates)

    If so is it possible to increase the limitation somehow?



    Thursday, March 29, 2018 11:38 AM

All replies

  • Hi JohanStang,

    >>If so is it possible to increase the limitation somehow?

    I am sure what kind of data type you are using, could you please describe it in detailed, such as data structure. in addition, you could also the data type named text, which variable-length Unicode data with a maximum string length of 2^30 - 1 (1,073,741,823) bytes.

    Best regards,

    Zhanglong


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, March 30, 2018 5:33 AM
    Moderator
  • It is of the type DbGeometry and I am insering a line with many coordinates into it.

    I am creating the the from WKT like this:
    DbGeometry newMapLine = DbGeometry.LineFromText(<WKT Formated String>, 3006);

    Tuesday, April 3, 2018 7:47 AM