{"id":2728,"date":"2026-04-20T09:30:44","date_gmt":"2026-04-20T13:30:44","guid":{"rendered":"https:\/\/www.mymiller.name\/wordpress\/?p=2728"},"modified":"2026-04-20T09:30:44","modified_gmt":"2026-04-20T13:30:44","slug":"geo-location","status":"publish","type":"post","link":"https:\/\/www.mymiller.name\/wordpress\/geo\/geo-location\/","title":{"rendered":"Geo &#8211; Location"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">So we have Latitude and Longitude, putting those together we have a location now.  That is simple enough, but once we have a location, we can use that to derive other locations.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Deriving new locations<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">We create the addDistanceEast(), addDistanceWest(), addDistanceNorth(), and addDistanceSouth() methods to generate a new location-based on our current location.  Now, something to note in these methods uses the <a href=\"https:\/\/www.mymiller.name\/wordpress\/programming\/java\/unitofdistance\/\">UnitOfDistance <\/a>class, to specify the Unit of your distance.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Distance Between locations<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You can find the distanceTo() method which takes a GeoLocation, and a <a href=\"https:\/\/www.mymiller.name\/wordpress\/programming\/java\/unitofdistance\/\">UnitOfDistance <\/a>to return the distance between the two locations.  <\/p>\n\n\n\n<div class=\"wp-block-coblocks-gist\"><script src=\"https:\/\/gist.github.com\/Ghost-Programmer\/de0fb8d2a91398cae68843843af14a04.js\"><\/script><noscript><a href=\"https:\/\/gist.github.com\/Ghost-Programmer\/de0fb8d2a91398cae68843843af14a04\">View this gist on GitHub<\/a><\/noscript><\/div>\n","protected":false},"excerpt":{"rendered":"<p>So we have Latitude and Longitude, putting those together we have a location now. That is simple enough, but once we have a location, we can use that to derive other locations. Deriving new locations We create the addDistanceEast(), addDistanceWest(), addDistanceNorth(), and addDistanceSouth() methods to generate a new location-based on our current location. Now, something [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2724,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[454],"tags":[291],"series":[288],"class_list":["post-2728","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-geo","tag-geo","series-geo"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2020\/04\/street-map-2679271_640.jpg?fit=640%2C332&ssl=1","jetpack-related-posts":[{"id":2072,"url":"https:\/\/www.mymiller.name\/wordpress\/java_extra\/unitofdistance\/","url_meta":{"origin":2728,"position":0},"title":"UnitOfDistance &#8211; Measure and Convert your distance","author":"Jeffery Miller","date":"April 20, 2026","format":false,"excerpt":"Well I was bored one night after creating the UnitOfMemory and decided what else could be useful in the future. \u00a0I came up with a UnitOfDistance to convert distances over land. \u00a0Miles v's kilometers and everything in between. \u00a0The class was easy to come up with, finding the exact conversion\u2026","rel":"","context":"In &quot;Java Extras&quot;","block_context":{"text":"Java Extras","link":"https:\/\/www.mymiller.name\/wordpress\/category\/java_extra\/"},"img":{"alt_text":"UnitOfDistance","src":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2017\/02\/tape-measure-1860811_640.jpg?fit=640%2C426&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2017\/02\/tape-measure-1860811_640.jpg?fit=640%2C426&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2017\/02\/tape-measure-1860811_640.jpg?fit=640%2C426&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":2734,"url":"https:\/\/www.mymiller.name\/wordpress\/geo\/geo-fence\/","url_meta":{"origin":2728,"position":1},"title":"Geo &#8211; Fence","author":"Jeffery Miller","date":"December 24, 2025","format":false,"excerpt":"Every need to define an area and determine if a location is within that range? This is called a GeoFence. Very handy and useful for any kind of GPS tracking. Define the GeoFence area, then you can use checkInside() to see if a GeoLocation is inside or outside of the\u2026","rel":"","context":"In &quot;Geo&quot;","block_context":{"text":"Geo","link":"https:\/\/www.mymiller.name\/wordpress\/category\/geo\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2020\/04\/map-2789052_640.jpg?fit=640%2C426&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2020\/04\/map-2789052_640.jpg?fit=640%2C426&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2020\/04\/map-2789052_640.jpg?fit=640%2C426&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":2732,"url":"https:\/\/www.mymiller.name\/wordpress\/geo\/geo-path\/","url_meta":{"origin":2728,"position":2},"title":"Geo &#8211; Path","author":"Jeffery Miller","date":"December 24, 2025","format":false,"excerpt":"Once you have GeoLocations, you can then make shapes for them. So we create a GeoShape Interface that allows us to define our shape. View this gist on GitHub We implement a forEach() method to be able to act on each location in the shape, and a getGeoPath() to return\u2026","rel":"","context":"In &quot;Geo&quot;","block_context":{"text":"Geo","link":"https:\/\/www.mymiller.name\/wordpress\/category\/geo\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2020\/04\/treasure-map-1850653_640.jpg?fit=640%2C426&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2020\/04\/treasure-map-1850653_640.jpg?fit=640%2C426&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2020\/04\/treasure-map-1850653_640.jpg?fit=640%2C426&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":2730,"url":"https:\/\/www.mymiller.name\/wordpress\/geo\/geo-line\/","url_meta":{"origin":2728,"position":3},"title":"Geo &#8211; Line","author":"Jeffery Miller","date":"April 20, 2026","format":false,"excerpt":"One of the simplest shapes we can make is GeoLine. It consists of two GeoLocations the start, and end of the line. The line is the simplest of shapes but is used by other shapes to make their structure. View this gist on GitHub","rel":"","context":"In &quot;Geo&quot;","block_context":{"text":"Geo","link":"https:\/\/www.mymiller.name\/wordpress\/category\/geo\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2020\/04\/chart-1110428_640.jpg?fit=640%2C257&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2020\/04\/chart-1110428_640.jpg?fit=640%2C257&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2020\/04\/chart-1110428_640.jpg?fit=640%2C257&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":2726,"url":"https:\/\/www.mymiller.name\/wordpress\/geo\/geo-latitude-longitude\/","url_meta":{"origin":2728,"position":4},"title":"Geo &#8211; Latitude &#038; Longitude","author":"Jeffery Miller","date":"April 20, 2026","format":false,"excerpt":"Latitude and Longitude implementation for Geo API.","rel":"","context":"In &quot;Geo&quot;","block_context":{"text":"Geo","link":"https:\/\/www.mymiller.name\/wordpress\/category\/geo\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2020\/04\/globe-71443_640.jpg?fit=640%2C426&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2020\/04\/globe-71443_640.jpg?fit=640%2C426&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2020\/04\/globe-71443_640.jpg?fit=640%2C426&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":3754,"url":"https:\/\/www.mymiller.name\/wordpress\/spring_discovery\/conquering-distance-federated-service-discovery-with-spring-cloud-and-consul\/","url_meta":{"origin":2728,"position":5},"title":"Conquering Distance: Federated Service Discovery with Spring Cloud and Consul","author":"Jeffery Miller","date":"April 20, 2026","format":false,"excerpt":"Microservices excel at breaking down monolithic applications into smaller, manageable units. But as your system expands across multiple data centers or cloud providers, a new challenge emerges: how do services discover each other across these geographical boundaries? Traditional service discovery, with a single registry, can struggle with latency and fault\u2026","rel":"","context":"In &quot;Spring Discovery&quot;","block_context":{"text":"Spring Discovery","link":"https:\/\/www.mymiller.name\/wordpress\/category\/spring_discovery\/"},"img":{"alt_text":"","src":"https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/network-6564511_1280-jpg.avif","width":350,"height":200,"srcset":"https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/network-6564511_1280-jpg.avif 1x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/network-6564511_1280-jpg.avif 1.5x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/network-6564511_1280-jpg.avif 2x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/network-6564511_1280-jpg.avif 3x"},"classes":[]}],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/posts\/2728","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/comments?post=2728"}],"version-history":[{"count":3,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/posts\/2728\/revisions"}],"predecessor-version":[{"id":2755,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/posts\/2728\/revisions\/2755"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/media\/2724"}],"wp:attachment":[{"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/media?parent=2728"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/categories?post=2728"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/tags?post=2728"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/series?post=2728"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}