Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

GeoData and working with boundary data.

  • 20-08-2009 08:23AM
    #1
    Registered Users, Registered Users 2 Posts: 1,127 ✭✭✭


    Im building a Google Maps API-driven website at the moment, and Im struggling with one piece of functionality. This is possibly more a maths question than a programming question, so apologies if its in the wrong forum.

    Here's the issue:

    1. I want to provide a user with the ability to search using lat/lng coordinates.
    2. There are polygons on the map, which use coordinates to draw shapes for example:
    <coordinates>-6.31468,52.770005,0
                  -6.316997,52.77165,0
                  -6.31812,52.773106,0
                  -6.321028,52.774235,0
                  -6.338126,52.784717,0
                  -6.344469,52.789479,0
                  -6.344738,52.790201,0
                  -6.349238,52.790663,0
                  -6.352504,52.795531,0
                  -6.353728,52.795911,0
                  -6.358247,52.794122,0
                  -6.364439,52.795095,0
                  -6.366511,52.794642,0
                  -6.368848,52.795195,0
                  -6.374655,52.792611,0
                  -6.377603,52.789493,0
                  -6.38272,52.787786,0
                  -6.388535,52.784898,0
                  -6.391839,52.785065,0
                  -6.396398,52.788359,0
                  -6.405923,52.783593,0
                  -6.408646,52.780883,0
                  -6.415013,52.776284,0
                  -6.415823,52.776072,0
                  -6.416414,52.771944,0
                  -6.413825,52.768146,0
                  -6.416946,52.763158,0
                  -6.415987,52.761948,0
                  -6.417233,52.76171,0
                  -6.4166,52.75774,0
                  -6.417376,52.755339,0
                  -6.425517,52.753509,0
                  -6.432069,52.754503,0
                  -6.433884,52.739097,0
                  -6.433656,52.735681,0
                  -6.433891,52.735147,0
                  -6.43131,52.735431,0
                  -6.427952,52.732477,0
                  -6.420346,52.733196,0
                  -6.41888,52.732781,0
                  -6.415941,52.733502,0
                  -6.409838,52.737718,0
                  -6.411418,52.74204,0
                  -6.405784,52.742871,0
                  -6.398607,52.746256,0
                  -6.394074,52.747032,0
                  -6.388356,52.749092,0
                  -6.383637,52.748677,0
                  -6.380542,52.744317,0
                  -6.381206,52.742349,0
                  -6.380767,52.741092,0
                  -6.381187,52.739311,0
                  -6.375228,52.734738,0
                  -6.375029,52.733814,0
                  -6.372594,52.732901,0
                  -6.371651,52.730578,0
                  -6.368595,52.725971,0
                  -6.372103,52.723879,0
                  -6.370228,52.719189,0
                  -6.368242,52.716646,0
                  -6.366222,52.715359,0
                  -6.365689,52.713734,0
                  -6.365992,52.713559,0
                  -6.36483,52.713,0
                  -6.361301,52.712424,0
                  -6.355368,52.713033,0
                  -6.352718,52.712341,0
                  -6.349806,52.712347,0
                  -6.343594,52.710914,0
                  -6.337275,52.713699,0
                  -6.337812,52.715144,0
                  -6.339229,52.716782,0
                  -6.340165,52.716965,0
                  -6.340795,52.718168,0
                  -6.338141,52.719961,0
                  -6.335507,52.721224,0
                  -6.334507,52.724265,0
                  -6.335059,52.724989,0
                  -6.334189,52.725693,0
                  -6.334614,52.72656,0
                  -6.330546,52.729628,0
                  -6.328099,52.730073,0
                  -6.327076,52.73143,0
                  -6.325314,52.731602,0
                  -6.326248,52.732429,0
                  -6.325274,52.734209,0
                  -6.32604,52.73655,0
                  -6.327084,52.73711,0
                  -6.327092,52.738544,0
                  -6.328917,52.738748,0
                  -6.330363,52.739667,0
                  -6.330941,52.740035,0
                  -6.332631,52.742219,0
                  -6.335873,52.743975,0
                  -6.336881,52.74553,0
                  -6.33815,52.745169,0
                  -6.339294,52.746265,0
                  -6.340523,52.746094,0
                  -6.341809,52.748682,0
                  -6.344998,52.750345,0
                  -6.346257,52.750136,0
                  -6.348305,52.753432,0
                  -6.344214,52.758028,0
                  -6.342101,52.758167,0
                  -6.340868,52.759409,0
                  -6.338788,52.759559,0
                  -6.338478,52.759914,0
                  -6.337601,52.759731,0
                  -6.336065,52.760049,0
                  -6.334922,52.761352,0
                  -6.328523,52.763876,0
                  -6.32611,52.764549,0
                  -6.324673,52.764198,0
                  -6.320507,52.765064,0
                  -6.314439,52.768563,0
                  -6.313819,52.769273,0
                  -6.31468,52.770005,0</coordinates>
    
    3. There are multiple nodes in a KML file which contain this type of boundary information, I want to return the node information which pertains to the boundary that the lat/lng appears in.

    Sorry if Im unclear? Im using Java to process this, so far (in pseudo code) I have.

    1. Read all values from coordinates into multi-dimensional arrays
    2. Accept user data

    Where to from here?


Comments

Advertisement