1

For a personal website I would like to plot coordinates of for example historic events etc. on an existing image.

This can be a photograph of an area of which I look up the coordinates of the 4 corners (put those in the database with the url of the image).

Based on the coordinate of the historic event I can select which photographs contain that coordinate and draw the event-coordinate on the selected picture.

This image should be created in php. What is the best solution to do this?

Sorry I'm a newbie in GIS, I only have this idea which I'd like to execute and so I came here.

  • To clarify, do you want to generate a new photo with the coordinate marker added into the image, or do you want to generate HTML that shows the original photo and shows some kind of marker in the correct position? – Marc Pfister Sep 8 '17 at 14:24
  • The first, I would like to have the image with marker included (so if you save the image, you have everything). – Jens Verweert Sep 15 '17 at 9:20
1

Since you know the four corners and the location of the marker, you can calculate the location of the marker within the image in units of pixels.

You can then use an image library like Imagick to composite a marker image or place an appropriate text-based marker at that location. You may have to compensate for the width and height of the marker.

The technique is similar to watermarking and there are lots of tutorials on accomplishing this in PHP

  • Thank you very much for this very interesting information! Seems certainly what I want to achieve. – Jens Verweert Sep 18 '17 at 8:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.