Query to Rip the X & Y from a Geometry column

  • Hi everyone,

    I am trying to rip the x and y coordinates from a geometry column(geom) can anyone would help me in optimizing or is there any other way to get the x & y since there are 210 polgons in the geom column and where we try to rip the data its would be around 15 milllin records.Here is the query i am trting to use to rip the coordinates

    select

    CONVERT(INT,ID) as DMAID

    ,n.n AS PolygonOrder

    ,geom.STPointN(n.n).STX as lat

    ,geom.STPointN(n.n).STY AS Long

    from dbo.MAP m

    inner join nums n

    on n.n <= geom.STNumPoints()

    Any help would be appreciated

    Thanks in advance!!!!!

  • Since this sat around a bit here, I'll ask the obvious. Can you post the DDL and a few rows of sample data here, specifically for the Map table? I assume numbers is simply a Tally table.


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply