Page 2 of 2 FirstFirst 12
Results 21 to 29 of 29
  1. #21
    RealSmile is offline Member
    Join Date
    Feb 2014
    Posts
    18
    Rep Power
    0

    Default Re: How do I create a pair of longitude and latitudes to show a 2 mile radius of a pa

    Quote Originally Posted by Norm View Post
    Are you asking: given a center point, how to determine a large number of points that are on the circumference of a circle centered on that center point and that are the radius distance from the center point?
    Sounds right. I'm asking how I can determine the longitude and latitude coordinates that create a 1 mile radius around the user's location within android java. I don't mind how many coordinates it takes, but I'd like to create a circular radius around one location.

  2. #22
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,397
    Rep Power
    25

    Default Re: How do I create a pair of longitude and latitudes to show a 2 mile radius of a pa

    The 4 points in the cardinal directions: N,E,S,W are the easy ones. (One minute of latitude = 1 nautical mile) Longitude distances are changed by the cosine??? of the latitude. 1 minute of long = 1 nm at the equator with the distance being reduced as the lat increases. For example at lat 33, one minute of long might be .78 nm
    The other points will take some trigonometry.

    There might be methods to do all that.
    Last edited by Norm; 02-24-2014 at 05:51 PM.
    If you don't understand my response, don't ignore it, ask a question.

  3. #23
    RealSmile is offline Member
    Join Date
    Feb 2014
    Posts
    18
    Rep Power
    0

    Default Re: How do I create a pair of longitude and latitudes to show a 2 mile radius of a pa

    Could you please suggest a method which can accomplish the task defined earlier? Thanks :-)

  4. #24
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,397
    Rep Power
    25

    Default Re: How do I create a pair of longitude and latitudes to show a 2 mile radius of a pa

    I'd do some research in the API doc to see what classes and methods might be useful.
    If there aren't any that do what you want, then you might have to come up with some trig equations.

    For an easy test, try creating the 4 cardinal points (N,E,S,W) at the radius distance from the center point and draw a line through those points. That should give you a diamond.
    If you don't understand my response, don't ignore it, ask a question.

  5. #25
    RealSmile is offline Member
    Join Date
    Feb 2014
    Posts
    18
    Rep Power
    0

    Default Re: How do I create a pair of longitude and latitudes to show a 2 mile radius of a pa

    The api doesn't seem to offer much help in that regard.
    I mean no disrespect. Although what has been mentioned within this thread, has been insightful. As of yet no one has suggested any Java code which could help me solve this problem. I don't expect anyone to do all the work for me, but I hoped someone would be able to help with the coding. Which is why I've come to a Java forum, is anyone able to help in this fashion?

  6. #26
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,397
    Rep Power
    25

    Default Re: How do I create a pair of longitude and latitudes to show a 2 mile radius of a pa

    What do you know how to code now? Can you draw a PolyLine between two LatLng points?
    Here's some code that might do part of that. I don't have a test machine setup to see what it does.
    Java Code:
    	        LatLng coxFord = new LatLng(35.8671, -84.43983);
    	        LatLng schellKnob = new LatLng(34.61009, -83.607);
    	        PolylineOptions plo = new PolylineOptions().color(Color.YELLOW).width(routeWidth);
    	        plo.add(schellKnob, coxFord);
            
    	        Polyline pl = gMap.addPolyline(plo);
    Once you can draw some lines, then move to drawing the 4 lines around the center point between the 4 cardinal points that were mentioned.
    Last edited by Norm; 02-25-2014 at 06:14 PM.
    If you don't understand my response, don't ignore it, ask a question.

  7. #27
    RealSmile is offline Member
    Join Date
    Feb 2014
    Posts
    18
    Rep Power
    0

    Default Re: How do I create a pair of longitude and latitudes to show a 2 mile radius of a pa

    Quote Originally Posted by Norm View Post
    What do you know how to code now? Can you draw a PolyLine between two LatLng points?
    Here's some code that might do part of that. I don't have a test machine setup to see what it does.
    Java Code:
    	        LatLng coxFord = new LatLng(35.8671, -84.43983);
    	        LatLng schellKnob = new LatLng(34.61009, -83.607);
    	        PolylineOptions plo = new PolylineOptions().color(Color.YELLOW).width(routeWidth);
    	        plo.add(schellKnob, coxFord);
            
    	        Polyline pl = gMap.addPolyline(plo);
    Once you can draw some lines, then move to drawing the 4 lines around the center point between the 4 cardinal points that were mentioned.
    Yes, I know how to code. I thought my coding example was evidence enough of that, the code you just posted is useless. It has nothing to do with what I'm asking.
    I'm not asking how to draw lines or polygons etc. I've been asking how I can generate the appropriate longitude and latitudes to form a 2 mile radius around a particular location (longitude and latitude), which the above code does nothing to achieve.

  8. #28
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,397
    Rep Power
    25

    Default Re: How do I create a pair of longitude and latitudes to show a 2 mile radius of a pa

    This thread has been a waste of time.
    Ask a search engine how to draw a circle and a simple, direct, easy solution is shown.
    Last edited by Norm; 02-26-2014 at 01:43 PM.
    If you don't understand my response, don't ignore it, ask a question.

  9. #29
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,397
    Rep Power
    25

    Default Re: How do I create a pair of longitude and latitudes to show a 2 mile radius of a pa

    If you don't understand my response, don't ignore it, ask a question.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 11
    Last Post: 01-01-2014, 08:24 PM
  2. Replies: 0
    Last Post: 01-01-2014, 04:47 PM
  3. how can i create a string that show what key the user pressed?
    By I Lost My Name! in forum New To Java
    Replies: 2
    Last Post: 12-31-2013, 01:32 AM
  4. Convert XL data in to latitude longitude format?
    By suresh.somepalli in forum Android
    Replies: 4
    Last Post: 11-01-2012, 02:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •