Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Adjust for distortion using when importing a shapefile

    I imported a shape file that contains the 210 DMAs for the 50 US states using sph2data. DMAs are regions where the population can receive the same (or similar)TV and radio programming. I then manually adjusted the (X,Y) coordinates for the AK and HI DMAs to lie under the continental US. Unfortunately, my map appears distorted, with the US stretched along the east-west axis.

    Here's an example of the DMA map on the left, with CBSAs and state boundaries on the right:
    Click image for larger version

Name:	Screen Shot 2018-08-14 at 10.18.10 AM.png
Views:	1
Size:	472.0 KB
ID:	1458146




    Is this an artifact of the projection inherited from the shapefile, or is there something I can do to scale the (X,Y) coordinates?
    Last edited by Dimitriy V. Masterov; 14 Aug 2018, 11:36.

  • #2
    I scaled the Y coordinate with:

    Code:
    replace _Y = _Y*1.35;
    which got me this something more reasonable:

    Click image for larger version

Name:	Screen Shot 2018-08-14 at 10.44.12 AM.png
Views:	1
Size:	498.2 KB
ID:	1458149

    Comment


    • #3
      But I would still love any suggestions to make the left one better.

      Comment


      • #4
        It looks like you are trying to create a map (the one on the left) using geographic coordinates (lat/lon). To get a map that looks like the one on the right, you have to apply a map projection. See geo2xy (from SSC), in particular the "Fun with maps" help page that shows how to create a composite map of the 48 conterminous states with Alaska and Hawaii.

        Also see this recent post for additional examples with labels.

        Comment


        • #5
          Another thing to be aware of is that some individual states maintain their own official projections that will adjust the spherical coordinates to a Cartesian plane. I can’t remember it off the top of my head, but I know Mississippi has its own official projection which is essentially designed to reduce visual artifacts that might appear using Mercator or other types of projections. If there is a file with the extension .prj with the rest of the shapefile data that will tell you what projection the shapefile is using to encode the coordinates and there are some websites that you can use to search for the different projection codes if you need to do anything more specific.

          Comment


          • #6
            Thank you for your help, Robert and William. Let me look into your suggestions.

            Comment

            Working...
            X