Friday, May 10, 2019

How to Converting a .jpg map into a shapefile In Arcgis

Converting a .jpg map into a shapefile

First 

There is no direct route to convert an image into a shapefile format. Your jpg map has no spatial reference. You can load it into arcmap but it won't know where to put it. In order to tell arcmap where it belongs in space you have to provide geographic reference points, hence the term 'georeferencing'.

In ArcGIS this is done via the Georeferencing Toolbar, which is turned off by default. To turn it on you just right-click on a toolbar, look for Georeferencing and turn it on. Then you will use the 'Add control points' tool (first button after right of the combo box) to tell arcgis what points on the image correspond to points on a second data source that already has a spatial reference.

Here are the steps I recommend following:

  1. Open a new arcmap document.
  2. Load an existing, vector shapefile of the counties you are interested in
  3. Load the jpg of the map you want to georeference
  4. In the Table of Contents, right click on the map and select 'Zoom to Layer'
  5. Click on the 'Add Control Points' button on the georeferencing toolbar
  6. Find a point on the map that you can match to the shapefile you loaded in step 2 and click on it. I recommend finding places that are easy to identify such as intersections of major roads, sharp corners in boundaries, etc
  7. Then click on the 'Previous Extent' arrow on the toolbar to zoom back to your shapefile and move the map so that you can see the point you picked in the previous step in the shapefile.
  8. Click on the corresponding point in the shapefile. You should see your map appear in the vicinity of where you clicked. It may be very small, or it might be huge, don't worry, you'll fix that with the next step.
  9. Now you are going to repeat the last two steps using a second point on the jpg map, preferably one that is relatively far from the first one, but just go with what you can for now.
  10. Repeat the process a few times and try to get the jpg as closely matched to the shapefile as possible. You'll never get it 100 percent accurate, but you can get pretty close if you try. If something goes crazy and the map gets really distorted you can either start over entirely or delete the last control point you added using the 'View Link table' button on the georeferencing toolbar.

Then it's just a matter of either editing your existing shapefile or creating a new one using the jpg map as a background. You'll probably have to assign some attribute data such as "Damaged" or "County Name" to the polygons you draw but that is a whole other issue.

I'm sure it sounds complicated if you've never done it before but it's really pretty easy once you get your head around the concept. Just remember that there are three fundamental steps here 1) Georeference the jpg so your GIS knows where it is in space, 2) Create a new dataset from the jpg in vector format, 3) Use the attribute table from your new dataset to conduct your analysis.

Here are some links that may be helpful: Get A - Z of Arcgis text book from HeroizuTech Services Ltd

http://www.heroizutech.com.ng 

For the second phase you will have to create a new shapefile. You will use the editing tools inside arcmap to digitize the affected areas as new polygons.

1) Create a new shapefile. Open up arcCatalog and navigate to the folder you are working in. Right click and select New --> Shapefile...

2) Give your shapefile a name and under feature type select 'Polygon'

3) Click the Edit... button in the lower right and select the coordinate system you want to work with, this should probably be the same as the one used by the county base file you used to georef the map jpg.

4) Open your arcmap document with the georeferenced jpg map and add your new shapefile to the document.

5) Right click on your new shapefile in the Table of Contents, got to 'Edit Features' and select 'Start Editing'.

6) Now you can use the 'Create Features' window to digitize the affected areas on your jpg map. Make sure to save your edits often using the Editing Toolbar.

7) Once you have drawn/digitized over all the affected areas save your edits and click on the 'stop editing' button.

8) Right click on your shapefile in the table of contents and select 'Open Attribute Table'. In the window that pops up, click on the drop-down button in the upper left and select "Add Field"

9) Name your field 'Area' and select 'Double' under type.

10) You should see your new field show up as a column on the right of your attribute table, right click on its heading and select 'Calculate Geometry', choose area and the units you want, this will tell you the area of each of the polygons you digitized.

That should give you everything you need to show the affected areas on a map and calculated the total area. Again, if you need further details or more instructions these steps have been heavily documented all over the web and a search for 'arcgis create shapefile' or something similar will give you lots of results with pictures/video that will be more descriptive than my summary.


Regarding your last comment: You should now have three items in your table of contents. One should be the jpg map you georeferenced, a second should be the county map you used to georeference the jpg map, and the third should be the polygons of affected areas you just digitized.

To make a map that you can export and use as an image or figure somewhere else (ie a report or webpage) you will need to switch ArcMap over to 'Layout' view. (Go to the 'View' menu and choose 'Layout View') This is where you can add items like a legend, north arrow, and scale (via the Insert menu). Once you have things looking the way you would like them go to File, Export Map..., and choose the location, format, and resolution for the file you want to export. Then you will have an image file of the map you just laid out that you can use elsewhere.

I realize those instructions are pretty bare bones - if you need more help than that then that should really be a separate question, or the focus on how to get my book A-Z of Arcgis 

No comments:

Post a Comment