DevLog #3
Replies: 7 comments 1 reply
-
2/3/23Used https://www.inchcalculator.com/convert-degrees-minutes-seconds-to-decimal/ to find the formula to convert DMS (degrees, minutes, seconds) coordinates into DD (Decimal Degrees). Now have coordinates from the image. Reading about the different routing engines I can use. Ideally, I will hit an api endpoint. I don’t want to get into any sort of backend or hosting. |
Beta Was this translation helpful? Give feedback.
-
3/15/23Didn’t do anything on the project since last devlog. Now working on this locally. Was able to hook up the Graphhopper API after getting an API key, and finally submitted two points. First point is a “default location” and second point is extracted from photo. Running into issues of chaining; will need to refactor. Figuring out promises and async - need to get exif data value from function before executing the routing engine api call |
Beta Was this translation helpful? Give feedback.
-
3/16/23Accomplishments
Mistakes + Learnings
Next stepswill likely make issues of many of the below
|
Beta Was this translation helpful? Give feedback.
-
3/19Achievements
Learnings + ideas
|
Beta Was this translation helpful? Give feedback.
-
3/20 devlogAdded:
Learnings
Looking into:
May potentially use |
Beta Was this translation helpful? Give feedback.
-
3/21 devlogAdded
Learnings
|
Beta Was this translation helpful? Give feedback.
-
3/22 - 3/23Added
Learning
Considering
To Ticket
|
Beta Was this translation helpful? Give feedback.
-
DEVLOG
2/2/23
OK, finally just jumping in and trying to figure this out. I’ll start with a CodePen since that’s even easier than starting something and running a local server IMO.
https://codepen.io/LaneGoodman/pen/dyjwdWB?editors=0111
I’m thinking I can just add a <file type=”input”> and then get going. This does let me access a file dialogue. What happens to the file after that? Here’s where I’m now reading this: HTML Input type=”file” element.
OK, so it sounds like the file can be loaded into the browser’s local memory, and not sent to a server, so I don’t have to worry about setting up any sort of backend or database at this point.
Let’s look at the Exif JS library, which I had found previously and planned on using.
… lots of trying to figure out how to read the exif data from the uploaded file…
… reading the File API spec…
I’m calling the exif library, but when I try to console log the exif data, I only see “true.” Damn, what am I doing wrong?
Looking at stack overflow, though I’m trying to avoid this because I know the answer to my whole project is on there somewhere… OH! I stupidly was using an arrow function, and forgot that there’s no “this” for the function. EXIF relies on “this” so that won’t work.
Using a normal function expression… works! I can read the EXIF data now of an uploaded image from the file browser. (Later, will need to explore looping through an array of uploaded images)
OK, now I can see all the exif tags. Which one do I need? Looks like they are all listed here as part of the GPSTags list: https://github.com/exif-js/exif-js/blob/master/exif.js#L134
I think I just need lat/long - so that would be GPSLatitude, and GPS Longitude. (Could be interesting to check out GPSImgDirection, GPSDestBearing later)
OK, these are served as arrays of three numbers according to this issue. (There’s some code in here but I want to ignore it so I don’t see the answer right away.) What does that mean? A quick search yields that this is a separate number for degrees, minutes, and seconds. OK, gonna go learn a bit more about lat/long
Reading
References
Beta Was this translation helpful? Give feedback.
All reactions