Bounding box of each country

Home Forums Natural Earth Map Data Cultural Vectors Bounding box of each country

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #3369

    Turban
    Participant

    Hi,

     

    Anyone who knows how I can retrieve the bounding box of a given country in this dataset (MultiPolygon)?

     

    Bjørn

     

    #3986

    Nathaniel
    Keymaster

    The current 1.0 version does not have that as an attribute. The 1.1 version to be released soon does. In the meantime, here’s how to calculate that using ArcMap Field Calculator VBA prelogic:

    dim Output as double

    dim pGeom as IGeometry

    set pGeom = [shape]

    Output = pGeom.Envelope.XMin

    Then put Output in the 2nd text field in the field calculator dialog and complete dialog.

    #3987

    holgerschurig
    Participant

    In a shape file, e.g. in 50m-admin-0-countries.shp, the entries are sorted in exactly the s

    $ shapelib-1.3.0b1/dbfdump 50m-cultural/50m-admin-0-countries.shp | cut -c1-20 | head -n 4

    COUNTRY

    Afghanistan

    Albania

    Algeria

    shapelib-1.3.0b1/shpdump 50m-cultural/50m-admin-0-countries.shp | grep -A1 “Bounds:” | head

    File Bounds: ( -180.000, -89.999,0,0)

    to ( 180.000, 83.600,0,0)

    Bounds:( 60.486, 29.392, 0)

    to ( 74.891, 38.456, 0)

    Bounds:( 19.281, 39.653, 0)

    to ( 21.031, 42.648, 0)

    Bounds:( -8.683, 18.987, 0)

    to ( 11.968, 37.092, 0)

    #3988

    holgerschurig
    Participant

    Ah, it sucks that you don’t have a “preview” and that there is no “edit” capability. The first paragraph should be:

    In a shape file, e.g. in 50m-admin-0-countries.shp, the entries are sorted

    in exactly the same order as in the accomanying database. Therefore you can

    use low-level tools, e.g. from shapelib, to dump both files and correlate

    the data:

    #3989

    Nathaniel
    Keymaster

    @holgerschurig: Sorry about that. bbPress is from the same folks as WordPress but not quite as industrial strength. I’ve added a new plugin for the previews, hope it works.

    #3990

    Nathaniel
    Keymaster

    Oops, still not working. Let me tinker.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.