POST
|
You have to remember how US-centric ArcGIS is. Thank you! Am I supposed to mark this thread as answered or something?
... View more
04-10-2011
10:46 PM
|
0
|
0
|
423
|
POST
|
Thank you for your time. I have used the prj-files successfully in other scenarios, thats my reason to believe they work. As cooIn I use the file "SWEREF99 TM.prj" and for cooOut "RT90 25 gon V.prj". I found them under (App-Folder)\"Coordinate Systems\Projected Coordinate Systems\National Grids\Sweden\" My test coordinates is: x = 7454204.638 y = 761811.242 The result (in RT90 25 gon V) should be: pnt.X = 7453389.762 pnt.Y = 1727060.905 I'm using ArcView 9.3.1 and ArcGIS Desktop SDK .NET 9.3.3000.
... View more
04-08-2011
12:07 AM
|
0
|
0
|
423
|
POST
|
Hi! I have to convert a point from one coordinate system to another. I wrote this code (VB .NET) but it doesn't work that well. The result of IsEmpty for geo and pnt, in TransPoint, is always true. Why? Public Function TransPoint(ByVal x As Double, ByVal y As Double) As IPoint
Dim cooIn As IProjectedCoordinateSystem = LoadCoordinateSystem(...)
Dim cooOut As IProjectedCoordinateSystem = LoadCoordinateSystem(...)
' --
Dim pnt As IPoint = New PointClass()
pnt.PutCoords(x, y)
' --
Dim geo As IGeometry = pnt
geo.SpatialReference = cooIn
geo.Project(cooOut)
' --
Try
Dim xx As Double = pnt.X
Dim yy As Double = pnt.Y
MsgBox("pnt: " & xx & ", " & yy)
Catch ex As Exception
MsgBox( _
"geo.isEmpty: " & geo.IsEmpty & vbNewLine & _
"pnt.isEmpty: " & pnt.IsEmpty & vbNewLine & _
ex.Message)
Return Nothing
End Try
Return pnt
End Function
Private Function LoadCoordinateSystem(ByVal src As String) As IProjectedCoordinateSystem
Dim srf As ISpatialReferenceFactory = New SpatialReferenceEnvironmentClass()
Dim pcs As IProjectedCoordinateSystem = srf.CreateESRISpatialReferenceFromPRJFile(src)
Return pcs
End Function
... View more
04-07-2011
08:18 AM
|
0
|
5
|
609
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|