Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 311623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:56:30+00:00 2026-05-12T07:56:30+00:00

today i ran into a possible size limitation of geography type Linestrings within Sql

  • 0

today i ran into a possible size limitation of geography type Linestrings within Sql Server 2008.
when i create a Linestring with STGeomFromText() that contains 567 points containing Long,Lat and Z coordinates, everything works fine.

However, if i add one more point to the linestring i get an:

ArgumentException 24200: The specified input does not represent a valid geography instance.

I was not able to find any documentation regarding size limitations of sql server´s geography type linestrings or something similar.

Is this a limitation of geography or just of the STGeomFromtext() function?
Does anyone has some links to some more detailed information or is the only way to get around this splitting the linestring up into several smaller linestrings grouped together in a multilinestring.

Any help is appreciated 😉

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T07:56:31+00:00Added an answer on May 12, 2026 at 7:56 am

    I haven’t heard about any size limitations on LINESTRING (certainly not as short as 567 points).

    I just tried an example

    DECLARE @geom GEOGRAPHY
    SET @geom = GEOGRAPHY::STGeomFromText(
      'LINESTRING (142.98873903132778 -11.006193013241768
       , 142.9891970000001 -11.005916999999954
       -- SNIP 1,119 points
       , 142.04362479801711 -11.629451936538608 )', 4326)
    SELECT @geom, @geom.STNumPoints()
    

    which worked fine (creates the LINESTRING and counts 1,122 points).

    Does your example fail with ANY 567 points – or just a specific set of points (can you share them with us?). I guess I’m wondering whether your 568th point makes your GEOGRAPHY instance larger than a hemisphere? For example, if I change my example by adding another point (0,0) which forces the GEOGRAPHY to be too large:

    DECLARE @geom GEOGRAPHY
    SET @geom = GEOGRAPHY::STGeomFromText(
      'LINESTRING (142.98873903132778 -11.006193013241768
       , 142.9891970000001 -11.005916999999954
       -- SNIP 1,119 points
       , 142.04362479801711 -11.629451936538608
       , 0 0 )', 4326)         -- ADDED ANOTHER POINT !
    SELECT @geom, @geom.STNumPoints()
    

    I get ArgumentException 24205: The specified input does not represent a valid geography instance because it exceeds a single hemisphere. Each geography instance must fit inside a single hemisphere. A common reason for this error is that a polygon has the wrong ring orientation. which obviously isn’t the exact same error as you – but I thought I’d raise it anyway [Skip to the UPDATE at the end for a better idea]

    My second question to you is: does it work with the GEOMETRY datatype? Eg. if I change my “breaking” example above to use GEOMETRY then it works fine:

    DECLARE @geom GEOMETRY    -- using GEOMETRY type instead
    SET @geom = GEOMETRY::STGeomFromText(
      'LINESTRING (142.98873903132778 -11.006193013241768
       , 142.9891970000001 -11.005916999999954
       -- SNIP 1,119 points
       , 142.04362479801711 -11.629451936538608
       , 0 0 )', 4326)         -- THIS POINT BREAKS GEOGRAPHY but works now!
    SELECT @geom, @geom.STNumPoints()
    

    If you can post some more details on your specific problem it might suggest the underlying problem. Also could you add whether you are entering the points in SQL Management Studio or via code (is it C# and SQL data types assembly)? What is the full text of the error message you receive (if there is more than what you quoted above – see my error).

    But the short answer is “I don’t think there is a 567-point limit”.

    UPDATE: Ed’s post contains the exact error you get (System.ArgumentException: 24200) – so if you can get you data working in GEOMETRY instead, this might be worth a try:

    …able to get the geometry to convert to
    a geography using the following query:

    SELECT
    dbo.MakeValidGeographyFromGeometry(GEOM.Reduce(.0000001))
    FROM ZillowNeighborhoods WHERE ID = 3499

    So what is happening here? First of
    all, the tolerance used in the Reduce
    method is very small. So how many
    vertex points were removed from the
    original geometry by Reduce? It turns
    out that 6 vertices were removed. A
    quick discussion with the SQL Server
    spatial developers revealed that
    during current validation processing
    some very close vertices can shift
    slightly and cause edges to
    cross/overlap (remember that
    geographic edges are not straight
    lines…). In the next release of SQL
    Server (SQL11), we have changed the
    underlying methodology and eliminated
    this issue. For now, we will have to
    workaround this issue using Reduce
    with very small tolerances.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Today I ran into a weird problem. I have a database in SQL Server
Today I ran into an issue with LINQ to objects (not SQL) that popped
Today I ran into a scenario where I have to create a method that
I migrated an SVN server today and ran into an issue. I have a
I ran into a weird situation today doing some one-time sql code. This nested
I ran into an interesting SQL problem today and while I came up with
Possible Duplicate: ASP.Net and GetType() I ran into a slight problem today. As you
Today I ran into the following problem with NUnit. I have a class, that
today I ran into an error and have no clue how to fix it.
Today I ran into something a bit weird. I used mini-profiler to see the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.