Results 1 to 3 of 3

Thread: Converting Lat Lon to Geometry

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2013
    Posts
    43

    Converting Lat Lon to Geometry

    Hi All bear with me if this is the wrong forum i have SQL code to use in VB for converting Lat Lon to Geography but need to convert to Geometry any help much appreciated.

    Code:
     "UPDATE [dbo].[MyTable_Temp_Geo] SET [GEO_Location] = geography::STGeomFromText('POINT(' + CAST([Longitude] AS VARCHAR(20)) + ' ' + CAST([Latitude] AS VARCHAR(20)) + ')', 4326)"

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,102

    Re: Converting Lat Lon to Geometry

    Not sure if it's in the right forum or not. What is happening with the code you have? Are you getting errors, if so, what are they?
    My usual boring signature: Nothing

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Converting Lat Lon to Geometry

    If your issue is with the SQL rather than the VB code that executes the SQL then this should be in the Database Development forum. If you specify that that is the case, Shaggy can move the thread for you.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width