-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added CRS indexing based on an sqlite database #108
base: develop
Are you sure you want to change the base?
Conversation
Implemented a database service to obtain fast indexing of coordinates systems by codes from an sqlite database. Also added a file service to obtain indexing coordinates systems from a csv file. Fixed parsing errors of wkts and added and EXTENSION parse.
Travis Yeik seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
namespace ProjNet.Services | ||
{ | ||
public interface ICoordinateSystemService |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A public interface requires proper xml-code documentation
|
||
#endregion | ||
|
||
/// <summary> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a breaking change, uncomment and mark [Obsolete]
@@ -169,5 +169,18 @@ public void ReadAuthority(out string authority, out long authorityCode) | |||
long.TryParse(ReadDoubleQuotedWord(), NumberStyles.Any, _nfi, out authorityCode); | |||
ReadCloser(bracket); | |||
} | |||
|
|||
public void ReadExtension(out string extension, out string extensionMethod) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Separate PR would be great
I will separate out the EXTENSION. I am still not sure about the the sqlite database being part of the project. So I think I will redo it as well. I think that it is a great addition and rounds the project off, but I don't know how I feel about forcing people to download 6Mb of data if they don't want to use it. I think there are two options: 1) we leave it as a separate download on this github repository and people download it separately, then pass the connection string as a parameter or 2) the sqlite database, the DatabaseService, and the sqlite-net-pcl DLL is put a separate project that people can attach to ProjNet through the ICoordinateSystemService. Thoughts? Oh nevermind, I see your comments above. We are on the same page. |
I separated out the sql stuff to ProjNet.Sqlite. I also added unit test for each of the services. It looks a lot cleaner now. There are two EXTENSIONS, one to the Crs and one to the projection. Both of those are added. I really have no idea how to create a separate PR for only the extension stuff; is it possible to close #106 with this PR? |
Removed the AddParameter method. Added async search methods to the database.
Update for compatibility with Maui in iOs and Android (ie, embedded resources). Create the Database file if it cannot be found so that things don't crash.
Implemented a database service to obtain fast indexing of coordinates systems by codes from an sqlite database. Also added a file service to obtain indexing coordinates systems from a csv file.
Fixed parsing errors of wkts.
Added and EXTENSION parse.
There are now three CoordinateSystemServices:
I am not too sure about how to instantiate the database...
Previously, when CoordinateSystemServices is called without any parameters, it would initialize the Default CRS dictionary of WGS84 and TransMercator. I didn't think this was extremely viable (since it was only two coordinate systems), so I made the default constructor to call the database service. If you want to call the Default service, you should provide any enumeration (or null).
The database was stripped down a bit. For example, about 30 codes overlap with ESRI and EPSG. I removed the ESRI duplicates from the database so that I could make the PrimaryKey the code. I also remove the IGNF authority because these had string values as the code (instead of integer).
The only known problem that persists is parsing horizontal CS with more than two axis. I had commented this exception out while testing. Otherwise, all of the wkts in the database should parse.