GPX on client machine

Jun 24, 2010 at 4:38 PM
Thank you for sharing your code. Would you give me sample code on how to show a GPX file from the client machine? I am using your Vishcious.ArcGIS.SLContrib. Am I close??? private void btnLoadGPX_Click(object sender, RoutedEventArgs e) { //Create the dialog allowing the user to select a "*.GPX" file OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "GPX Files|*.gpx"; ofd.Multiselect = false; if( !( ofd.ShowDialog() ?? false ) ) return; //XAML binding <slContrib:GPXLayer ID="gpxLayer" URL="{Binding fileName}" /> fileName = ofd.File.Name; }
Coordinator
Jun 24, 2010 at 7:09 PM

Hi crperrea,

If you are reading from a local file, then open the file with the file dialog like you are and read it into a stream. 

Use GPXReader.ReadGPX(stream) to read contents into a gpxtype.

Use GPXHelper.LoadGraphics(gpxtype) to get a GraphicsCollection.

Set symbols to all Graphics in the GraphicsCollection and add them into the GraphicsLayer of your choice.

 

That's it.

 

Vish

http://www.Vishcio.us

 

Jun 24, 2010 at 10:14 PM

Worked, Thank You!

Jun 25, 2010 at 8:57 PM

Vish, Any tips on using Vishcious.ArcGIS.SLContrib to show my .GPX file on a map with a different Spatial Reference?

MyMap has SpatialReference WKID="26915" (NAD83 UTM Zone 15N)

Thank you, 

Craig

Jun 26, 2010 at 12:06 AM
Please stop sending mass email.

Sent from iPhone
Pardon the gramar~


On Jun 25, 2010, at 4:50 PM, "crperrea" <notifications@codeplex.com> wrote:

From: crperrea

Vish, Any tips on using Vishcious.ArcGIS.SLContrib to show my .GPX file on a map with a different Spatial Reference?

MyMap has SpatialReference WKID="26915" (NAD83 UTM Zone 15N)

Thank you,

Craig

Coordinator
Jun 29, 2010 at 1:23 PM

These are not mass emails. You will need to unsubscribe from notifications.

Thank You,

Vish

Coordinator
Jun 29, 2010 at 1:27 PM

Hi Craig,

Unfortunately, re-projection for the graphics layer is not supported. You will have to post the GraphicsCollection you get back from the reader to a GPTask to do the projection. You can also send the geometries to the Project operation on the Geometry service to do it for you.

 

Thank You,

Vish

http://www.Vishcio.us

Jun 29, 2010 at 6:47 PM

Vish,

 

Thanks, the Geometry service worked for me.  However, I cannot read tracks with GPXReader.  Can you read the tracks in the file: 106514.gpx located at:

 

ftp://ftp.dnr.state.mn.us/pub/outgoing/Test/

Craig

Coordinator
Jun 30, 2010 at 11:55 AM

I just fixed a small bug with reading tracks. Please try it out now and let me know if it worked for ya.

Thank you,

Vish

http://www.Vishcio.us

Jul 6, 2010 at 4:25 PM

Vish,

Thanks for updating GPXReader. I have a question on usage.

Do I need an update of Vishcious.ArcGIS.SLContrib.dll

If I can use the GPXReader without the DLL do you have a code sample?

Thank you,

Craig

Coordinator
Jul 6, 2010 at 4:47 PM

Hi Craig,

The easiest thing to do is to build the solution and reference the latest DLL of Vishcious.ArcGIS.SLContrib. You can also skim thru the code and just pick out what you need from it (no samples for this). 

 

Thank You,

Vish

http://www.Vishcio.us

 

Jul 13, 2010 at 2:01 PM

Vish,

Thanks, that worked for me.  However, I cannot read from an Android phone that uses encoding = "ISO-8859-1".  Any ideas?

Can you read the file: track5.gpx located at:

ftp://ftp.dnr.state.mn.us/pub/outgoing/Test/

Thanks again,

Craig