tag:blogger.com,1999:blog-5674879503126200888.post4391738500233359607..comments2023-10-22T06:30:57.331-07:00Comments on <a href="https://www.husseinnasser.com/p/about-hussein.html">Hussein Nasser</a>: Simple tool for Integrating ESRI ArcMap with Google EarthHussein Nasserhttp://www.blogger.com/profile/18310476423554125845noreply@blogger.comBlogger40125tag:blogger.com,1999:blog-5674879503126200888.post-28891420163577891162012-06-25T01:16:20.512-07:002012-06-25T01:16:20.512-07:00Hi Hussein,
I use ArcGIS 9.3.1 and tried to integ...Hi Hussein,<br /><br />I use ArcGIS 9.3.1 and tried to integrate this uicontrol, but it did not work. This error showing up "Compile error - Ambiguous name detected: StorageAreaConnections"<br />What is the problem? Can you help me.<br />Thank you.Anonymoushttps://www.blogger.com/profile/02453951442545721262noreply@blogger.comtag:blogger.com,1999:blog-5674879503126200888.post-85530317319878436402010-11-23T07:11:00.144-08:002010-11-23T07:11:00.144-08:00Hi Nouri,
This is an old version
Try this one in...Hi Nouri,<br /><br />This is an old version<br /><br />Try this one instead<br /><br />http://hnaser.blogspot.com/2009/07/arc2google.html<br /><br /><br />Hope this helpsHussein Nasserhttps://www.blogger.com/profile/18310476423554125845noreply@blogger.comtag:blogger.com,1999:blog-5674879503126200888.post-87393346569334519562010-11-23T06:49:25.964-08:002010-11-23T06:49:25.964-08:00hi Hussein,
i hve 2 pb:
1)i try this tool today, b...hi Hussein,<br />i hve 2 pb:<br />1)i try this tool today, but an error,"compile error; user-defined type not defined". can u help me to fix it?<br />2)is there a tool to convert from international coordinate system(ex(276372,873972)) to a gps coordinate system nd vice versa.<br />thank youFadhel Nourihttps://www.blogger.com/profile/02948771378855127392noreply@blogger.comtag:blogger.com,1999:blog-5674879503126200888.post-17092933086899778222009-10-11T05:59:34.529-07:002009-10-11T05:59:34.529-07:00i dont think so my code works correctly with sampl...i dont think so my code works correctly with sample data from esri but i cant understand now what is the problem anyway thanx so much for ur replies and ur time i appreciate ur helpUnknownhttps://www.blogger.com/profile/09394102724130807852noreply@blogger.comtag:blogger.com,1999:blog-5674879503126200888.post-35079672760207916682009-10-11T05:35:48.296-07:002009-10-11T05:35:48.296-07:00See the source code, i'm using the same projec...See the source code, i'm using the same projection<br /><br />maybe you are flipping the Lat/Lon positions? <br /><br />I mean maybe you placed the Latitude value in the Longtitde and vise versa ..<br /><br />try invereting them ..Hussein Nasserhttps://www.blogger.com/profile/18310476423554125845noreply@blogger.comtag:blogger.com,1999:blog-5674879503126200888.post-70043114135403906782009-10-11T04:55:30.910-07:002009-10-11T04:55:30.910-07:00ok it worx now but it just like my problem in goog...ok it worx now but it just like my problem in google earth when i pan my map the earth rotate in incorrect way can u tell me in what projection u projectedd ur data<br />my data projected in Geographic Coordinate ststem WGS 1984Unknownhttps://www.blogger.com/profile/09394102724130807852noreply@blogger.comtag:blogger.com,1999:blog-5674879503126200888.post-50450288292151307142009-10-11T04:43:41.927-07:002009-10-11T04:43:41.927-07:00This shouldn't be a problem
my code works in b...This shouldn't be a problem<br />my code works in both 9.2 and 9.3 ..<br /><br />Download arc2google you will see two folders 2005 and 2008 <br /><br />register the 2008 one.. (binary-> register.bat)Hussein Nasserhttps://www.blogger.com/profile/18310476423554125845noreply@blogger.comtag:blogger.com,1999:blog-5674879503126200888.post-58753744382578414392009-10-11T04:31:09.994-07:002009-10-11T04:31:09.994-07:00hi hussien ur code open arc 9.2 and i have 9.3
wh...hi hussien ur code open arc 9.2 and i have 9.3 <br />when i try to debug the project it says u need to register and another issue my arc map is setted up on d:\Unknownhttps://www.blogger.com/profile/09394102724130807852noreply@blogger.comtag:blogger.com,1999:blog-5674879503126200888.post-7721834300843800702009-10-11T03:56:25.322-07:002009-10-11T03:56:25.322-07:00This is the tool
http://hnaser.blogspot.com/2009...This is the tool <br /><br />http://hnaser.blogspot.com/2009/07/arc2google.htmlHussein Nasserhttps://www.blogger.com/profile/18310476423554125845noreply@blogger.comtag:blogger.com,1999:blog-5674879503126200888.post-84791356938887409502009-10-11T03:56:04.494-07:002009-10-11T03:56:04.494-07:00Anytime fatma,
well, this code is pretty old,
I...Anytime fatma,<br /><br />well, this code is pretty old, <br /><br />I have done a better code with .NET integrations ESRI ArcMap with Google Maps and google Earth <br /><br />Called it Arc2GoogleHussein Nasserhttps://www.blogger.com/profile/18310476423554125845noreply@blogger.comtag:blogger.com,1999:blog-5674879503126200888.post-10061648740027832882009-10-11T03:49:12.442-07:002009-10-11T03:49:12.442-07:00hi hussien thnx for reply
i use this function in m...hi hussien thnx for reply<br />i use this function in my script too<br />but the problem i think in the projection i use Geographic coordinate system wgs 84 but it still dont work with my data <br /><br />and i have problem in running ur code too it give error in "WithEvents" says invlaid used only with objectsUnknownhttps://www.blogger.com/profile/09394102724130807852noreply@blogger.comtag:blogger.com,1999:blog-5674879503126200888.post-4183267917060304222009-10-11T02:56:21.588-07:002009-10-11T02:56:21.588-07:00Hi Fatma,
You need to project your data into the G...Hi Fatma,<br />You need to project your data into the Google Earth Format ..<br /><br />this is the function that does the projection<br /><br />PointToLatLon .. in my script..<br /><br />Now I don't know of Flex.. but you must somehow converts the X/Y in ESRI Data into a Lat/Lon ,, once you done that.. the rest is easy ..Hussein Nasserhttps://www.blogger.com/profile/18310476423554125845noreply@blogger.comtag:blogger.com,1999:blog-5674879503126200888.post-87584283638875938812009-10-11T01:36:48.140-07:002009-10-11T01:36:48.140-07:00hi hussien i wanted to do like ur work but in flex...hi hussien i wanted to do like ur work but in flex with arcgis map service it works only with esri data when i pan in map it pan in google earth but the problem is it doesnot work with my data the earth rotate in incorrect way can u help plzUnknownhttps://www.blogger.com/profile/09394102724130807852noreply@blogger.comtag:blogger.com,1999:blog-5674879503126200888.post-49323481197884555932009-06-17T04:15:22.356-07:002009-06-17T04:15:22.356-07:00@Omar
Anytime bro, I hope it will be of use to you...@Omar<br />Anytime bro, I hope it will be of use to you and everybody.Hussein Nasserhttps://www.blogger.com/profile/18310476423554125845noreply@blogger.comtag:blogger.com,1999:blog-5674879503126200888.post-5751470725416597832009-06-17T02:41:46.009-07:002009-06-17T02:41:46.009-07:00Thanks Hussein, its a great tool congratulations f...Thanks Hussein, its a great tool congratulations for your workAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-5674879503126200888.post-52414487168500924712009-06-17T02:10:30.269-07:002009-06-17T02:10:30.269-07:00@Omar_Baphomet
When you open the vbeditor.
Delete ...@Omar_Baphomet<br />When you open the vbeditor.<br />Delete ALL THE CODE there<br />and copy the vba.txt content <br /><br />you pasted function inside another function :)Hussein Nasserhttps://www.blogger.com/profile/18310476423554125845noreply@blogger.comtag:blogger.com,1999:blog-5674879503126200888.post-81932610689856838312009-06-17T02:01:38.306-07:002009-06-17T02:01:38.306-07:00Hia, Hussein. I have a problem whit de code, whean...Hia, Hussein. I have a problem whit de code, whean i put the code in the VB Editor and i tray to close a message opens that say "Compile Error: nvalid attribute in sub o Function". Here is a Screenshoot if yiou like to check: http://my.jetscreenshot.com/451/20090617-yw3f-347kbAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-5674879503126200888.post-6701224794868924632009-05-08T10:32:00.000-07:002009-05-08T10:32:00.000-07:00@Elise
Thanks,
Enjoy and share :)@Elise<br />Thanks,<br />Enjoy and share :)Hussein Nasserhttps://www.blogger.com/profile/18310476423554125845noreply@blogger.comtag:blogger.com,1999:blog-5674879503126200888.post-50813808975295824322009-05-08T09:45:00.000-07:002009-05-08T09:45:00.000-07:00Great program!! It works great!
-EliseGreat program!! It works great!<br /><br />-EliseAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-5674879503126200888.post-5485574728522213182009-04-03T05:04:00.000-07:002009-04-03T05:04:00.000-07:00@Fathi,Now problemReplace the file path to your ge...@Fathi,<BR/>Now problem<BR/><BR/>Replace the file path to your ge.htm path<BR/>or simply use this instead <BR/><BR/>http://geshout.com/test/esrige.htm<BR/>I'll update the ESRI site :)<BR/><BR/>thanks for this insight.Hussein Nasserhttps://www.blogger.com/profile/18310476423554125845noreply@blogger.comtag:blogger.com,1999:blog-5674879503126200888.post-36524916400350144762009-04-03T05:01:00.000-07:002009-04-03T05:01:00.000-07:00sorry but your explain are not enoug for set up th...sorry but your explain are not enoug for set up this code.. for example i don't understand how can i set up the file's path.. can you give me further detail..thanks..fethi ataFethi atahttps://www.blogger.com/profile/15985375461392107658noreply@blogger.comtag:blogger.com,1999:blog-5674879503126200888.post-64864929816814957782009-03-22T12:08:00.000-07:002009-03-22T12:08:00.000-07:00Hi HusseinThanks Master,, I Will try it.RegardsCar...Hi Hussein<BR/><BR/>Thanks Master,, I Will try it.<BR/><BR/>Regards<BR/><BR/>CarlosCarlos Phttps://www.blogger.com/profile/05236383608529525087noreply@blogger.comtag:blogger.com,1999:blog-5674879503126200888.post-62263913126635015312009-03-22T11:02:00.000-07:002009-03-22T11:02:00.000-07:00Hi Carlos,just setup Your code to listen to the re...Hi Carlos,<BR/>just setup Your code to listen to the refresh event ..<BR/><BR/>Leave the code as it is.<BR/><BR/><BR/>Add a new UIButton, call it UIButtonControl1 and copy this code, right click on the button and click view source, you will see this<BR/><BR/><BR/>Private Sub UIButtonControl1_Click()<BR/><BR/> <BR/>End Sub<BR/><BR/><BR/>Add this code inside the sub so it will become like this <BR/><BR/>Private Sub UIButtonControl1_Click()<BR/> Dim pMxDoc As IMxDocument<BR/> Set pMxDoc = ThisDocument<BR/> Set m_pMap = pMxDoc.FocusMap<BR/> <BR/>End Sub<BR/><BR/><BR/>At the very top of the module copy this code.. <BR/><BR/><BR/>Private WithEvents m_pMap As Map <BR/><BR/><BR/>Private Sub m_pMap_ViewRefreshed(ByVal view As esriCarto.IActiveView, ByVal phase As esriCarto.esriViewDrawPhase, ByVal Data As Variant, ByVal envelope As esriGeometry.IEnvelope)<BR/> <BR/> <BR/>GoogleView_Click()<BR/><BR/>End Sub<BR/><BR/><BR/><BR/>This should work<BR/><BR/>Email me at hmohamed "AT" gisadwea DOT "ae" if it didn'tHussein Nasserhttps://www.blogger.com/profile/18310476423554125845noreply@blogger.comtag:blogger.com,1999:blog-5674879503126200888.post-72535922352912713942009-03-22T10:39:00.000-07:002009-03-22T10:39:00.000-07:00Hi HusseinIs awesome, it works perfect. Thanks I d...Hi Hussein<BR/><BR/>Is awesome, it works perfect. Thanks<BR/> I don’t know VBA code, I use a button in Arcmap to see in google earth program the view, but I have to click every time, and your code is automatic, maybe you can fix these code to make it automatic.<BR/><BR/>Thanks for your time<BR/><BR/><BR/>code:<BR/>Private Sub GoogleView_Click()<BR/> 'Sets the View in Google to [approximately] match the view in ArcMap<BR/> 'This uses the Google Earth SetCameraParams to jump to the location.<BR/> 'SetCameraParams zooms to a center point, the altitude value determines<BR/> 'how much area you will see. The program returns an altitude and center<BR/> 'point to approximately match the view extent of your map.<BR/> 'Works with 9.x basic ArcView license - tested with ArcGIS 9.1 and 9.3<BR/> <BR/> 'Version 1.3a - 12/03/2008 - Moved GE Object creation (now after check projection, etc.)<BR/> 'Version 1.3 - 12/2/2008 - Corrected problem with Geographic projections<BR/> 'and changed how you set the view altitude (now does it after the projection).<BR/> 'Version 1.2 - Modified 9/10/2008 - Made a few corrections<BR/> 'Previously Modified 4/18/2007 - Added delay option when loading Google Earth<BR/> 'Optional: Set reference to the Google [Earth Type 1.0 Library]<BR/> 'Originally Created 03/22/2007 by Joel Stocker, UConn CES<BR/> <BR/> 'ArcGIS map parameters<BR/> Dim pMxDoc As IMxDocument<BR/> Dim pMap As IMap<BR/> Dim pMapsActiveView As IActiveView<BR/> Dim pEnvelope As IEnvelope<BR/> Dim pCenterPt As IPoint<BR/> Dim pEnvSpatRef As ISpatialReference<BR/> Dim pSRI As ISpatialReferenceInfo<BR/> Dim pPCS As IProjectedCoordinateSystem<BR/> Dim viewAlt As Double<BR/><BR/> 'Set the ArcMap values<BR/> Set pMxDoc = Application.Document<BR/> Set pMap = pMxDoc.FocusMap<BR/> Set pMapsActiveView = pMap<BR/> Set pEnvelope = pMapsActiveView.Extent<BR/> Set pCenterPt = New Point<BR/> Set pEnvSpatRef = pEnvelope.SpatialReference<BR/> <BR/> 'Check to make sure the map is projected<BR/> If pEnvSpatRef Is Nothing Then<BR/> MsgBox "Please set a projection for your Map", vbOKOnly, "No Projection Set"<BR/> Exit Sub<BR/> ElseIf TypeOf pEnvSpatRef Is IUnknownCoordinateSystem Then<BR/> MsgBox "Please set a projection for your Map", vbOKOnly, "Projection Unknown"<BR/> Exit Sub<BR/> End If<BR/><BR/> 'Create a WGS84 spatial reference for LatLong in Google Earth<BR/> Dim pSpRef2 As ISpatialReference<BR/> Dim pSpRFc As SpatialReferenceEnvironment<BR/> Dim pGCS As IGeographicCoordinateSystem<BR/> Set pSpRFc = New SpatialReferenceEnvironment<BR/> Set pGCS = pSpRFc.CreateGeographicCoordinateSystem(esriSRGeoCS_WGS1984)<BR/> Set pSpRef2 = pGCS<BR/> pSpRef2.SetFalseOriginAndUnits -180, -90, 1000000<BR/> <BR/> 'Project the envelope to WGS84<BR/> pEnvelope.Project pSpRef2<BR/> <BR/> 'Get the Center Point: ((XMin + XMax) / 2, (YMin + YMax) / 2)<BR/> pCenterPt.PutCoords (pEnvelope.LowerLeft.x + pEnvelope.LowerRight.x) / 2, _<BR/> (pEnvelope.LowerLeft.y + pEnvelope.UpperRight.y) / 2<BR/> <BR/> 'Check if map has been properly set<BR/> If Abs(pCenterPt.y) > 90 Or Abs(pCenterPt.x) > 180 Then<BR/> MsgBox "The view center (" & pCenterPt.y & ", " & pCenterPt.x & ") is out of " & _<BR/> "range for GEarth" & vbCrLf & _<BR/> "You may need to check your projection or add a layer to the view.", _<BR/> vbOKOnly, "Google View"<BR/> Exit Sub<BR/> End If<BR/> <BR/> 'Method for calculating the view altitude - v1.3 modified 12/2/2008<BR/> 'You can tweak this part if you find a better way to set the elevation<BR/> 'for your area<BR/> Dim wDeg As Double 'Extent width in degrees<BR/> Dim wMeters As Double 'Extent width in meters at view center<BR/> Dim pi As Double<BR/> pi = 3.14159265358979<BR/> wDeg = pEnvelope.LowerLeft.x - pEnvelope.LowerRight.x<BR/> 'Formula for converting the width from degrees to meters<BR/> wMeters = wDeg * (Cos((pCenterPt.y) * (pi / 180)) * 111325)<BR/> viewAlt = Abs(Round(wMeters)) 'Simply setting the view altitude to the width (in meters)<BR/> <BR/>' 'If you want to use the extent height for elevation use this instead<BR/>' Dim hDeg As Double<BR/>' Dim hMeters As Double<BR/>' hDeg = pEnvelope.UpperLeft.Y - pEnvelope.LowerLeft.Y<BR/>' hMeters = hDeg * 111325 'latitude (y) is relatively constant across the globe<BR/>' viewAlt = Abs(Round(hMeters))<BR/> <BR/> 'Google Earth Parameters<BR/> 'See http://earth.google.com/comapi/ for details<BR/> 'To show help tips while editing this code, uncomment the IApplication and<BR/> 'comment the Object references. Also, set Google [Earth Type 1.0 Library] in<BR/> 'Tools >> References (available if Google Earth is installed).<BR/> <BR/> 'To show editing tips: Uncomment these two lines plus set GE reference...<BR/> 'Dim GE As IApplicationGE<BR/> 'Set GE = New ApplicationGE<BR/> <BR/> '...and Comment these three.<BR/> Dim GE As Object<BR/> Set GE = Nothing 'just in case still open<BR/> Set GE = CreateObject("GoogleEarth.ApplicationGE")<BR/> <BR/> 'Send the map values to Google Earth using GE.SetCameraParams<BR/> 'If you set the speed to 5 or more it snaps to the site (no transition), a lower<BR/> 'number (i.e. 3.5) helps show movement has taken place<BR/> 'Altitude modes: RelativeToGroundAltitudeGE = 1, AbsoluteAltitudeGE = 2<BR/> <BR/> Dim timeStamp As Date, timeChange As Long, yourReturn<BR/> 'I added this to provide a slight delay to wait for Google to 'really' finish loading<BR/> 'before sending the SetCameraParams command. An alternate is to wait for it to<BR/> 'respond that it is online, but sometimes you want to work offline<BR/> 'Note: This time delay option can be demanding on the processor, so comment it out if<BR/> 'it turns out to be a problem.<BR/> <BR/> If GE.IsInitialized = 0 Then 'If Google Earth not open then wait for it to open<BR/> timeStamp = Now<BR/> timeChange = 0<BR/> While (GE.IsInitialized = 0)<BR/> 'In theory this waits for Google Earth to load if it isn't open already<BR/> timeChange = DateDiff("s", timeStamp, Now) 'difference in seconds<BR/> 'Added this option to cancel 4/18/2007 (in case it get's stuck)<BR/> If timeChange > 120 Then 'wait X number of seconds, then prompt user<BR/> yourReturn = MsgBox("Google still waiting to load. Continue waiting?", vbYesNo, _<BR/> "Loading Google Earth")<BR/> If yourReturn = vbNo Then<BR/> End 'cancel routine<BR/> Else<BR/> timeStamp = Now 'start again for loop<BR/> timeChange = 0<BR/> End If<BR/> End If<BR/> Wend<BR/> <BR/> timeStamp = Now<BR/> timeChange = 0<BR/> While timeChange < 2<BR/> timeChange = DateDiff("s", timeStamp, Now) 'difference in seconds<BR/> Wend<BR/> 'Now set the Google Earth view<BR/> GE.SetCameraParams pCenterPt.y, pCenterPt.x, 0, 1, viewAlt, 0, 0.01, 3.5<BR/> <BR/> Else<BR/> 'If Google Earth already open, set the Google Earth view immediately<BR/> GE.SetCameraParams pCenterPt.y, pCenterPt.x, 0, 1, viewAlt, 0, 0.01, 3.5<BR/> End If<BR/> <BR/>End Sub<BR/><BR/>Private Function GoogleView_ToolTip() As String<BR/> 'Information displayed when mouse over the button<BR/> GoogleView_ToolTip = "Set Google Earth Extent to ArcMap Extent"<BR/>End Function<BR/><BR/>Private Function GoogleView_Message() As String<BR/> GoogleView_Message = "Opens Google Earth to Current View Extent"<BR/>End FunctionCarlos Phttps://www.blogger.com/profile/05236383608529525087noreply@blogger.comtag:blogger.com,1999:blog-5674879503126200888.post-40841141141137076822009-03-17T23:50:00.000-07:002009-03-17T23:50:00.000-07:00Guys,use this path insteadhttp://geshout.com/test/...Guys,<BR/>use this path instead<BR/><BR/>http://geshout.com/test/esrige.htm<BR/><BR/>it appears using the file locally generates some problems.Hussein Nasserhttps://www.blogger.com/profile/18310476423554125845noreply@blogger.com