Jump to content

 
Photo

Creating Boxes from coordinates

- - - - -

  • Please log in to reply
14 replies to this topic

#1
Phil_Edwards

Phil_Edwards

    Newbie

  • New Member
  • Pip
  • 5 posts
  • United Kingdom

Hi

I'm try to figure out how to create multiple boxes (polygons) using XY coordinates for each corner from an excel spread sheet? Any ideas?

Regards

Phil

#2
gregsd

gregsd

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 169 posts
  • Gender:Male
  • Location:Surrey, England.
  • Interests:Cycling, mostly off-road (MTB) riding.
  • United Kingdom

Hi

I'm try to figure out how to create multiple boxes (polygons) using XY coordinates for each corner from an excel spread sheet? Any ideas?

Regards

Phil


Phil,

What software are you using?

Greg.


Greg Driver

GIS Analyst
MapInfo User...!

#3
kjmcgrath

kjmcgrath

    Newbie

  • Validated Member
  • Pip
  • 6 posts
  • Gender:Male
  • Location:Madison, Wisconsin
  • United States

If you have the locations of the corners you might consider using google fusion tables. You can upload a spreadsheet (<100 mb) and in some cases (dependent on formatting of document, etc) and can plot these points on google maps with the "visualize" option. You then can export these points as kml to some gis (arc accepts kml) or file format converter. I have only used this for point locations but the person who showed it to me I think talked about polygon features also. Another great thing about this web application is using the power of google's semantic search to geolocate points form street addresses (pretty great way to find lat/lon of lots of points) Hope this helps.

Be well,

Kevin

#4
Phil_Edwards

Phil_Edwards

    Newbie

  • New Member
  • Pip
  • 5 posts
  • United Kingdom

ArcView and MapInfo

#5
Phil_Edwards

Phil_Edwards

    Newbie

  • New Member
  • Pip
  • 5 posts
  • United Kingdom

If you have the locations of the corners you might consider using google fusion tables. You can upload a spreadsheet (<100 mb) and in some cases (dependent on formatting of document, etc) and can plot these points on google maps with the "visualize" option. You then can export these points as kml to some gis (arc accepts kml) or file format converter. I have only used this for point locations but the person who showed it to me I think talked about polygon features also. Another great thing about this web application is using the power of google's semantic search to geolocate points form street addresses (pretty great way to find lat/lon of lots of points) Hope this helps.

Be well,

Kevin

Sounds interesting Kevin, I'll give it a try

Many thanks

Phil

#6
frax

frax

    Hall of Fame

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

for the KML route, it is not that hard to create a script to create the kml directly for this.
Hugo Ahlenius
Nordpil - custom maps and GIS
http://nordpil.com/
Twitter

#7
Nick H

Nick H

    Legendary Contributor

  • Validated Member
  • PipPipPipPipPip
  • 307 posts
  • Gender:Male
  • Location:Caversham, Reading, England.
  • United Kingdom

I'm try to figure out how to create multiple boxes (polygons) using XY coordinates for each corner from an excel spread sheet? Any ideas?


Hi Phil, just so that I understand the problem, your xy coordinates are OSGB grid coordinates for the corners of a large number of polygons and you'd like to convert these to a (OSGB-projected) polygon shape file?

Regards, N.
Caversham, Reading, England.

#8
gregsd

gregsd

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 169 posts
  • Gender:Male
  • Location:Surrey, England.
  • Interests:Cycling, mostly off-road (MTB) riding.
  • United Kingdom

ArcView and MapInfo



Depending on the format of your spreadsheet (4 corner points, bottom left & top right corner points?) then it's fairly straightforward to create these in MapInfo.

Greg.


Greg Driver

GIS Analyst
MapInfo User...!

#9
Phil_Edwards

Phil_Edwards

    Newbie

  • New Member
  • Pip
  • 5 posts
  • United Kingdom

I'm try to figure out how to create multiple boxes (polygons) using XY coordinates for each corner from an excel spread sheet? Any ideas?


Hi Phil, just so that I understand the problem, your xy coordinates are OSGB grid coordinates for the corners of a large number of polygons and you'd like to convert these to a (OSGB-projected) polygon shape file?

Regards, N.

Yes, that's correct

#10
frax

frax

    Hall of Fame

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

It is quite easy to do this in python, if I remember correctly there is even an example on how to do that in the ArcGIS help files.
Hugo Ahlenius
Nordpil - custom maps and GIS
http://nordpil.com/
Twitter

#11
Nick H

Nick H

    Legendary Contributor

  • Validated Member
  • PipPipPipPipPip
  • 307 posts
  • Gender:Male
  • Location:Caversham, Reading, England.
  • United Kingdom

Yes, that's correct.


I hope this isn't too gothic. My way of doing this is to use DNR Garmin, which is a (free) GPS add-on for ARC. However, it doesn't need either a GPS or ARC to work.

Download and DNR Garmin from the site below and install it:

http://www.dnr.state.../DNRGarmin.html

Put your polygon data into a spreadsheet, in the form shown in the attached JPG. There are three polygons in this example, labelled one to three. Note that the closing coordinate of each polygon must be the same as the starting coordinate and that each starting coordinate has a corresponding 'TRUE' in the 'new_seg' column.

Save the spreadsheet as a CSV. This will load into DNRG, from where it can be saved in a number of useful file formats including as a projected shape file and as a KML.

Just a few tips about using DNRG:

Firstly, as-installed DNR Garmin has a problem with converting accurately latitude and longitude coordinates to Ordnance Survey grid references (and vice-versa). After installing DNR Garmin correct this problem by editing the file ‘epsg’ in the directory C:\Program Files\dnrgarmin\proj\nad. Search this file on the term '27700' and replace the line following '# OSGB 1936 / British National Grid' with:

<27700> +proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +towgs84=446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894 +units=m +no_defs no_defs <>

all on one line.

Secondly, start DNR Garmin and go File -> Set Projection. In the box that pops-up click on the ‘EPSG’ radio button and then in the ‘POSC Codes:’ window type ‘27700’. Then press return. Under ‘Datums:’ you should now see ‘OSGB 36’ and under ‘Projections:’ you should see ‘British National Grid’, highlighted. Now click ‘OK’. These setting will ‘stick’ in DNR Garmin until you change them.

Thirdly, when you start DNRG dismiss any warning boxes that pop-up by clicking 'OK' (DNRG complains if you start it without a GPS receiver connected).

Regards, N.

Attached Files


Caversham, Reading, England.

#12
Phil_Edwards

Phil_Edwards

    Newbie

  • New Member
  • Pip
  • 5 posts
  • United Kingdom

ArcView and MapInfo



Depending on the format of your spreadsheet (4 corner points, bottom left & top right corner points?) then it's fairly straightforward to create these in MapInfo.

Greg.

Any hints?

Phil

#13
gregsd

gregsd

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 169 posts
  • Gender:Male
  • Location:Surrey, England.
  • Interests:Cycling, mostly off-road (MTB) riding.
  • United Kingdom

ArcView and MapInfo



Depending on the format of your spreadsheet (4 corner points, bottom left & top right corner points?) then it's fairly straightforward to create these in MapInfo.

Greg.


Any hints?

Phil



Phil,

I presume that you have the four coordinates values in the following format in Excel:

Attached File  boxes.png   24.47KB   16 downloads

where in this example x1,y1 = the bottom left and x4,y4 = the top right coordinate pairs.

If so, then open the spreadsheet in MapInfo, make it 'mappable' (Table - Maintenance - Table Structure) and check the tick box. At this point set the projection to be British Coordinate System - BNG. Then, open the MapBasic window within MapInfo - Options -> Show MapBasic window. Enter the following commands:



set coordsys table boxes
update boxes set obj=mbr(createline (x1,y1, x4,y4))

where boxes = the name of the table (spreadsheet) you're working with and x1,y1, x4,y4 are the name of the fields holding the coordinate values.

Let me know how you get on or if I've not quite understood your request!

Greg.


Greg Driver

GIS Analyst
MapInfo User...!

#14
natcase

natcase

    Ultimate Contributor

  • Validated Member
  • PipPipPipPipPipPip
  • 572 posts
  • Gender:Male
  • Location:Minneapolis, Minnesota
  • Interests:cartography
    aeshetics
    cartographic design
    John Bartholomew
    road maps
    large-scale mapping
  • United States

One further thing to consider: How do you want the edge lines to be "straight"? I don't know what scale you're working at, but earth curvature will make a noticeable difference at some point. Are the boxes all oriented to geographic N, E, S, W? Then the Google solutions will work fine, though especially at smaller scales and wider areas, and even more especially at high latitudes, a square in a rectangular projection will NOT look square on a globe...

Nat Case
INCase, LLC

Minneapolis, Minnesota USA
maphead.blogspot.com



#15
frax

frax

    Hall of Fame

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

For an all-Arc solution, you might be able to use this python/toolbox script to create lines out of your coordinates (you might have to have five coords to close them). And you also need to have an id to make make them into separate lines.

And then, from the lines you should be able to make polygons!
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

-->