Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to get the index of a point from geography?
    text
    copied!<p><br/> How can i get the index of a point which is in my LineString?<br /> I am using SQL Server 2008 R2.</p> <p>I do have a geography type where a LineString is saved in.<br /> I want now to get the <strong>index</strong> of <strong>two points</strong> on this <strong>LineString</strong>. So that I know <strong>which</strong> one <strong>occurs first</strong>.<br /> Is this somehow possible?<br /> Because right now i'm doing it for my self with a while loop... but it's really slow when i've got some more data in my database :/</p> <p><strong>EDIT:</strong> Ok, right now i'm trying to follow the solution from SQL to use CHARINDEX.<br /> <em>Some more background info:</em><br/> I do have a geo point, I do have a linestring. I did get the intersecting points with a radius around my point from the linestring. Ok, now i want to try to get with the <strong>first intersecting point</strong> the <strong>index</strong> from this point on the <strong>LineString</strong>.<br /> So i do have in my linestring some numbers like these patterns "1.123456 or 12.123456 or 123.123456" and my search point is also something like "1.123456 or 12.123456 or 123.123456"<br/></p> <p><em>The Problem</em> is, that <strong>STIntersection</strong> gives me some different <strong>numbers</strong> back which are <strong>variable</strong> at the <strong>fractional digits</strong>. I thought about some string formatting, but i don't know how i should solve this. If there would be some nice regex features i think it would make my life easyier :) I had a look through all of these <a href="http://msdn.microsoft.com/en-us/library/ms181984.aspx" rel="nofollow">functions</a> but couldn't find anything for my needs.<br/></p> <p>Maybe some more experienced people could help me with that.</p> <p>Thanks!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload