Search code examples
data-structuresgeolocationlocationstandardsstandards-compliance

Data Specification for Geolocation Info


I'm writing a little program (in c++, primarily) that will store optional information about the location of an object. Sort of like this:

class loc {
  private:
    double lat;
    double lon;
    string address;
}
class foo {
  private:
    string name;
    loc location;
}

I'm wondering what data format standards are extant that are relevant to the design of the "loc" class. I'm not, at this point, writing anything GIS or navigation related, but I would like to be able to handle and provide data to external libraries/programs with minimal complication. As such, finding some sort of standard for this type of data would be helpful.

I've seen some standards like the W3C API, but I'm not clear on how widely accepted that is. Is it acceptable to store only lat/lon and assume WGS84? Is it necessary to store the geodesy info as well?

Is it reasonable to have one class encompass both geodetic location and textual "address" information? Or is there a consensus that this should be separate?


Solution

  • I suggest you to go for Struct Address (Include more detailed information like street,House,City etc) for address, this way you can add much more details. If you are asking the user to input the address then it would be better approach.

    Your approach is also fine as the level of details depends on the set of operation that you want to do. for example if you want to find the differences between altitudes of two points then you might have to add Altitude as data member.

    At the end It depends on the requirement

    P.S About the Geodesy doubt...the answer depends on the type of operation you want to use.