Jump to content

 
Photo

ArcGIS - create box

- - - - -

  • Please log in to reply
10 replies to this topic

#1
frax

frax

    Hall of Fame

  • Associate Admin
  • PipPipPipPipPipPipPip
  • 2,320 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Interests:music, hiking, friends, nature, photography, traveling. and maps!
  • Sweden

Hi,

Often I run into a need to create a box bounded by coordinates - I have an old AML to create a coverage for that (it creates a grid with those coords as a window, and then does a grid poly for that) - but is there really no way to do this easily directly in modern day Arc?

I want to create just a one polygon shape file, with the borders defined by the coords I punch in.

Maybe I should try to put this together myself... could be a decent exercise in Python!
Hugo Ahlenius
Nordpil - custom maps and GIS
http://nordpil.com/
Twitter

#2
Matthew Hampton

Matthew Hampton

    Hall of Fame

  • Moderator
  • PipPipPipPipPipPipPip
  • 1,326 posts
  • Gender:Male
  • Location:Portland, Oregon
  • Interests:Playing in the mountains and rivers.
  • United States

One method you could use would be to "Add x/y data..." to create points at your desired coordinates - then set your snapping environment to snap to points and draw your box. It's not fully automated - but you'd get your box at the right x/y. Scripting it in Python wouldn't be a bad idea either.

I'm surprised I couldn't find anything on Arcscripts as it seems like someone else would've created this already. Perhaps that person is you! :D

co-cartographic creator of boringmaps.com


#3
paul

paul

    Key Contributor

  • Validated Member
  • PipPipPip
  • 75 posts
  • Location:Logan, UT
  • Interests:Running, telemark skiing, GIS
  • United States

In ArcMap, go into edit mode, set your polygon layer as the target, then right-click anywhere in the map. When the context menu pops up, select "Absolute X, Y...". Type the coordinates of one of corners. Repeat 3 more times to create a box.

If you wanted to adjust an existing polygon, you could double-click on the feature to show vertices, then right-click on any vertex, and select "Properties" from the context menu. Then you can edit the coordinates of all vertices in the feature you selected.

If you need to create an entire vector grid, with a specific origin and box (cell) size, you can install a free extension called Hawths Tools.

#4
François Goulet

François Goulet

    Ultimate Contributor

  • Validated Member
  • PipPipPipPipPipPip
  • 689 posts
  • Gender:Male
  • Location:Mille-Isles, Qc
  • Interests:Cartography, History, Graphic Design and almost everything else...
  • Canada

You could probably add your points too and use a script (they're some of them on ArcScript) to create the convex envelope of your points (if you don't have a concave area).

#5
DaveB

DaveB

    Hall of Fame

  • Validated Member
  • PipPipPipPipPipPipPip
  • 1,057 posts
  • Gender:Not Telling
  • Location:Redlands, CA
  • United States

Hi,

Often I run into a need to create a box bounded by coordinates - I have an old AML to create a coverage for that (it creates a grid with those coords as a window, and then does a grid poly for that) - but is there really no way to do this easily directly in modern day Arc?

I want to create just a one polygon shape file, with the borders defined by the coords I punch in.

Maybe I should try to put this together myself... could be a decent exercise in Python!


I'm not sure I understand your question, but...

If you need to create a shapefile that has a rectangle with specific corner points you can do that in a couple of ways (at least).
1. create an empty polygon shapefile (you can do this in ArcCatalog or you could just create a copy of an existing shapefile and delete all of the features). Start editing the shapefile and create new features. You can use the rectangle tool in the editing tools to create a rectangle that's roughly what you want and then start editing the vertices, open the sketch properties and edit the values to get the exact values you want. Or you can type "e" while creating the rectangle and enter exact coordinates.
or
2. draw a graphic rectangle in data view and convert it to a feature. Typing "e" while drawing the rectangle also works for graphic rectangles.

oops, Paul beat me to the answer :)
Dave Barnes
Esri
Product Engineer
Map Geek

#6
kay

kay

    Key Contributor

  • Validated Member
  • PipPipPip
  • 65 posts
  • Canada

One method you could use would be to "Add x/y data..." to create points at your desired coordinates - then set your snapping environment to snap to points and draw your box. It's not fully automated - but you'd get your box at the right x/y. Scripting it in Python wouldn't be a bad idea either.


I do the same as the way Matthew suggested. In this case, you can keep the original tabular dataset with XY coordinates as a record... then just use the snapping to the points in the point layer... (I personally like the snapping environment in ArcGIS while editting :) ) If the boundary box is one... this is not a bad idea at all :) If you have a lot of box you have to make using known point coordinates... Python would be very powerful and efficient .

- Kay

#7
Unit Seven

Unit Seven

    Legendary Contributor

  • Moderator
  • PipPipPipPipPip
  • 266 posts
  • Gender:Male
  • Location:New Zealand
  • New Zealand

Do a search for the ARD Toolbar. This has a tool called the MapExtents Tool and draws a rectangle to the current layout frame into a Map Extent shp file with your desired map name, frame rotation, and scale. This allows you to add more rectangles (map extents) to th eshapefile with the press of a button.

Is a great tool for creating Mapbook DS layouts that are a bit more flexable than the map grid tools in Mapbook DS as you can pan and zoom around and just hit create extent and get all that needed to drive Mapbook DS.

The great thing is you can choose to make new shp file from within the tool so no jumping out to catalog etc.

My only gripe is that it only works with page units set to inches but that's less of an issue for all you statesiders.
S a m B r o w n

U N I T S E V E N
unit.seven@gmail.com

Miramar, Wellington
N E W Z E A L A N D

#8
ProMapper

ProMapper

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 216 posts
  • Gender:Female
  • Location:India
  • Interests:promapper@gmail.com
  • India

Well, I find Global Mapper to be the easiest to create a new box kind of shp file. If you want a rectangle (or a square) area or line, you can just key in the the two diagonally opposite co-ordinates and that's just about it.

However if one needs a polygon, then just click the same number of vertices that you want in the polygon in the drawing area of the Global Mapper, save it as an xyz file, open the xyz file in the notepad and replace those points with the long lat of the vertices that you want. Well, the approach is suitable say upto ten odd vertices or may be more for the highly patient and diligent type.

Anu
http://www.mapsandlocations.com

#9
frax

frax

    Hall of Fame

  • Associate Admin
  • PipPipPipPipPipPipPip
  • 2,320 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Interests:music, hiking, friends, nature, photography, traveling. and maps!
  • Sweden

Thanks for confirming that there is no easy shortcut to do this! My AML script still works fine, of course, and I will look into moving it to a Python script at some point...

Sam, I will take a peek at that toolbar, but i I am not so keen in working with inches...
Hugo Ahlenius
Nordpil - custom maps and GIS
http://nordpil.com/
Twitter

#10
Unit Seven

Unit Seven

    Legendary Contributor

  • Moderator
  • PipPipPipPipPip
  • 266 posts
  • Gender:Male
  • Location:New Zealand
  • New Zealand

You only have to switch to inches for the feature creation then you can go back to other units. And it gives a useful error message if you do try—but save a bookmark or remember your scale as Arcmap seems to sometimes jump the view in or out when you change units.
S a m B r o w n

U N I T S E V E N
unit.seven@gmail.com

Miramar, Wellington
N E W Z E A L A N D

#11
frax

frax

    Hall of Fame

  • Associate Admin
  • PipPipPipPipPipPipPip
  • 2,320 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Interests:music, hiking, friends, nature, photography, traveling. and maps!
  • Sweden

If anyone is interested - I have created that script in Python now, quite a good learning experience. For the actual toolbox, I would have preferred to have use it as an extent parameter, but I can't figure out how to set it so that it defaults to show the "As specified below" option (and the ToolValidator is not very easy to work with). If anyone can help with that, please let me know!

If you want to try it - the toolbox is attached to this post. Please let me know if you have tested it, and if there were any problems. If it looks good, I will post it to ArcScripts later!

Attached File  hugos_toolbox.zip   4.24KB   123 downloads
Hugo Ahlenius
Nordpil - custom maps and GIS
http://nordpil.com/
Twitter




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

-->