Select to view content in your preferred language

Create Shapefile

2518
6
Jump to solution
08-12-2014 12:49 PM
jaykapalczynski
Honored Contributor

Is it possible to draw on the map - then Create and Export a shapefile

1 Solution

Accepted Solutions
jaykapalczynski
Honored Contributor

I was able to do this with some older code from the link above....see attached zip.

Unzip and create virtual directory on web server

Then navigate in URL to  http:// server info \ js2shapefile\tests\Test_EsriDrawToShapefile.html

Note there is no prj file created....manually project a file to:

Projected Coordinate System:  WGS_1984_world_Mercator , Meter

Then use this .prj file (renamed to output file) and it will render perfectly.

I am going to try and get the code to create this .prj file automatically but cant afford the time now.

NOTE: that this example is using older code and api references I have not yet tried to update these.

View solution in original post

0 Kudos
6 Replies
RobertScheitlin__GISP
MVP Emeritus

Jay,

   There a couple of javascript libraries that come up in Google when you search.

js2shapefile - ESRI shapefile creator in javascript - Google Project Hosting

You would have to use a library like this. I personally don't have any experience doing this yet but it is an interesting idea.

0 Kudos
jaykapalczynski
Honored Contributor

yea this is going to be a touch one....I looked at that example and only a .shp file is exported....no dbf or shx...and written a while ago.....hmmmmm

I tried to bring the files local but not getting the Button to appear to export....have to be doing something wrong...

its using https://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.6

anyone else out there dable in exporting a Shapefile from graphic?

0 Kudos
RichardDaniels
Frequent Contributor

The answer is YES if you are talking about ArcGIS Desktop 10.2.x.

Do the following:

1. Turn on the Drawing toolbar in ArcMap

2. Draw your graphics

3. Select your graphic points, lines, or polygons graphics - can't "mix" the data types

4. Right click on your Data Frame (e.g., "Layers"  by default) in the Table of Contents

5. Select Convert Graphics to Features <-- this is new at 10.2

There are code samples to do this in ArcScripts as well at

http://arcscripts.esri.com/details.asp?dbid=14751

Rich

0 Kudos
jaykapalczynski
Honored Contributor

This is for JavaScript API...but thank you for your thoughts

0 Kudos
jaykapalczynski
Honored Contributor

I was able to do this with some older code from the link above....see attached zip.

Unzip and create virtual directory on web server

Then navigate in URL to  http:// server info \ js2shapefile\tests\Test_EsriDrawToShapefile.html

Note there is no prj file created....manually project a file to:

Projected Coordinate System:  WGS_1984_world_Mercator , Meter

Then use this .prj file (renamed to output file) and it will render perfectly.

I am going to try and get the code to create this .prj file automatically but cant afford the time now.

NOTE: that this example is using older code and api references I have not yet tried to update these.

0 Kudos
RichardDaniels
Frequent Contributor

that just points out how screwed up the new geoNet is.