-
Notifications
You must be signed in to change notification settings - Fork 24
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
PSP-7158 Show markers positioned corresponding to that file #4147
Changes from all commits
16caaec
c7c0dcb
993d273
8203d0c
72c36ab
05a1905
721e8bd
d8caae7
7bdcb25
a44409e
9e3ab50
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -377,6 +377,40 @@ public void UpdateLocation(PimsProperty incomingProperty, ref PimsProperty prope | |
} | ||
} | ||
|
||
public T PopulateNewFileProperty<T>(T fileProperty) | ||
{ | ||
// TODO: Remove this casting when LOCATION gets added to all remaining file-property types (research, disposition, lease) | ||
if (fileProperty is PimsPropertyAcquisitionFile acquisitionFileProperty) | ||
{ | ||
// convert spatial location from lat/long (4326) to BC Albers (3005) for database storage | ||
var geom = acquisitionFileProperty.Location; | ||
if (geom is not null && geom.SRID != SpatialReference.BCALBERS) | ||
{ | ||
var newCoords = _coordinateService.TransformCoordinates(geom.SRID, SpatialReference.BCALBERS, geom.Coordinate); | ||
acquisitionFileProperty.Location = GeometryHelper.CreatePoint(newCoords, SpatialReference.BCALBERS); | ||
} | ||
} | ||
|
||
return fileProperty; | ||
} | ||
|
||
public void UpdateFilePropertyLocation<T>(T incomingFileProperty, T filePropertyToUpdate) | ||
where T : IWithPropertyEntity | ||
{ | ||
// TODO: Remove this casting when LOCATION gets added to all remaining file-property types (research, disposition, lease) | ||
if (incomingFileProperty is PimsPropertyAcquisitionFile incomingAcquisitionProperty | ||
&& filePropertyToUpdate is PimsPropertyAcquisitionFile acquisitionPropertyToUpdate) | ||
{ | ||
// convert spatial location from lat/long (4326) to BC Albers (3005) for database storage | ||
var geom = incomingAcquisitionProperty.Location; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does the above casting also check for null? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also - a note that this casting will go away this sprint with the story to use location on other file types |
||
if (geom is not null && geom.SRID != SpatialReference.BCALBERS) | ||
{ | ||
var newCoords = _coordinateService.TransformCoordinates(geom.SRID, SpatialReference.BCALBERS, geom.Coordinate); | ||
acquisitionPropertyToUpdate.Location = GeometryHelper.CreatePoint(newCoords, SpatialReference.BCALBERS); | ||
} | ||
} | ||
} | ||
|
||
public IList<PimsHistoricalFileNumber> GetHistoricalNumbersForPropertyId(long propertyId) | ||
{ | ||
|
||
|
@@ -415,6 +449,12 @@ public List<T> TransformAllPropertiesToLatLong<T>(List<T> fileProperties) | |
{ | ||
foreach (var fileProperty in fileProperties) | ||
{ | ||
// TODO: Remove this casting when LOCATION gets added to all remaining file-property types (research, disposition, lease) | ||
if (fileProperty is PimsPropertyAcquisitionFile acquisitionFileProperty && acquisitionFileProperty.Location is not null) | ||
{ | ||
acquisitionFileProperty.Location = TransformCoordinates(acquisitionFileProperty.Location); | ||
} | ||
|
||
TransformPropertyToLatLong(fileProperty.Property); | ||
} | ||
|
||
|
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.
does this casting check for null?