Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 499151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:57:22+00:00 2026-05-13T05:57:22+00:00

I have found the shape data for the borders of all the countries and

  • 0

I have found the shape data for the borders of all the countries and a class to process it and I have written a script to convert the longitude and latitude to a pixel location on an image and to draw the countries using imagefilledpolygon and imageline. Everything is working great except:

1) I have a $scale variable that I can change. At $scale=1 the image is 360×180 pixel (1 pixel = 1 degree latitude/longitude). Ideally the final image I want would be about $scale = 2 (720×360) however the borderlines at 1 pixel thick look very thick. So I thought the best solution would be to generate the map at $scale=10 and then resize the generated image. The problem is imagecopyresized does not antialias when it resizes and it leaves me with a really jagged image, how can I resize and antialias?

2) The number of points to generate a polygon of a country is a LOT. The plan is to use the same code to produce an HTML imagemap to make the countries into links. However I fear at the moment there are too many points for an imagemap (the file size might be too big). My initial approach was to skip x amount of points, which lead to some success, If I process 1 in 10 points I get an acceptable result mostly. Ideally I would have even less… when I tried 1 in 40 I found some country borders overlapped and there were some gaps between countries (but some of the busier coastlines looked better). What is a sensible way to reduce the number of points whilst maintaining a reasonable level of accuracy?

If anyone is interested I’ll post the code (once it’s finished.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T05:57:23+00:00Added an answer on May 13, 2026 at 5:57 am

    For the simplification/approximation of the curves take a look at https://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a dataframe latitude and longitude points in R. Using the R data
I have found and customized this JQuery script, which displays different content when different
I have a task to convert the data design in XML format to a
I have a server side code to process uploaded binary files: class UploadHandler(webapp.RequestHandler): def
I'm probably doing this all wrong. I have a text file full of data
I have found Okapi Similarity measure can be used to calculated document similarity from
I have found that I have no problem using require to load something like
I have found many great answers to this from a year ago (when it
I have found this link: http://www.jfree.org/forum/viewtopic.php?f=3&t=6314 Its back in 2007 where they agree that
I have found that call stack helps in finding the line number of a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.