gdauby / ConR

ConR
https://gdauby.github.io/ConR/
14 stars 3 forks source link

Trouble using a protected areas shapefile #6

Closed amcilwee closed 1 year ago

amcilwee commented 4 years ago

Hi, I'd like to run IUCN.eval on fauna and flora species in New South Wales (Australia). I want to create maps and look at the status of species post the 2019-2020 bushfire season, so I am substituting a RFS fire extent map for National Park boundaries. The problem I have, is that no matter what shapefile I include - I get an error "Error in { : task 1 failed - "need finite 'ylim' values" when creating png maps, and "Error in { : task 1 failed - "figure margins too large" when creating pdf maps.

This only seems to happen when the script hits a species that has records inside the fire-affected area.

I have attached a test file (frog records) and associated shapefiles. The settings I've applied are:

Results <- IUCN.eval(MyData, country_map = NSW_NPWS_Branch, Cell_size_AOO = 2, Cell_size_locations = 10, SubPop=TRUE, Resol_sub_pop = 5, method_locations = "fixed_grid", Rel_cell_size = 0.05, DrawMap = TRUE, add.legend = TRUE, file_name = NULL, export_shp = TRUE, write_shp = TRUE, write_results=TRUE, map_pdf = TRUE, draw.poly.EOO=TRUE, exclude.area = TRUE, method_protected_area = "other", protec.areas=NSW_RFS_FireExtent, ID_shape_PA = "FID_RFSfir", buff_width = 0.1, alpha=0.9, buff.alpha=0.1, method.range="alpha.hull", nbe.rep.rast.AOO=0, showWarnings=TRUE, write_file_option="csv", parallel=TRUE, NbeCores=12)

NSW_ConR_Test.zip

Cheers, Allen

PS. Is there a way I can change "number of protected areas" on the maps to "number of records in burnt area". In updated versions, it would also be great if a shapefile of the point locations of each species could be automatically generated (in the folder shapesIUCN), along with the EEO and subpop polys.

gdauby commented 4 years ago

Hi I am on the field with limited email access until 26th March. I try to look at this asap, perhaps before that date. Best regards Gilles

Le lun. 9 mars 2020 à 05:11, amcilwee notifications@github.com a écrit :

Hi, I'd like to run IUCN.eval on fauna and flora species in New South Wales (Australia). I want to create maps and look at the status of species post the 2019-2020 bushfire season, so I am substituting a RFS fire extent map for National Park boundaries. The problem I have, is that no matter what shapefile I include - I get an error "Error in { : task 1 failed - "need finite 'ylim' values" when creating png maps, and "Error in { : task 1 failed - "figure margins too large" when creating pdf maps.

This only seems to happen when I the script hits a species that has records inside the fire-affected area.

I have attached a test file (frog records) and associated shapefiles. The settings I've applied are:

Results <- IUCN.eval(MyData, country_map = NSW_NPWS_Branch, Cell_size_AOO = 2, Cell_size_locations = 10, SubPop=TRUE, Resol_sub_pop = 5, method_locations = "fixed_grid", Rel_cell_size = 0.05, DrawMap = TRUE, add.legend = TRUE, file_name = NULL, export_shp = TRUE, write_shp = TRUE, write_results=TRUE, map_pdf = TRUE, draw.poly.EOO=TRUE, exclude.area = TRUE, method_protected_area = "other", protec.areas=NSW_RFS_FireExtent, ID_shape_PA = "FID_RFSfir", buff_width = 0.1, alpha=0.9, buff.alpha=0.1, method.range="alpha.hull", nbe.rep.rast.AOO=0, showWarnings=TRUE, write_file_option="csv", parallel=TRUE, NbeCores=12)

NSW_ConR_Test.zip https://github.com/gdauby/ConR/files/4304736/NSW_ConR_Test.zip

Cheers, Allen

PS. Is there a way I can change "number of protected areas" on the maps to "number of records in burnt area"

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gdauby/ConR/issues/6?email_source=notifications&email_token=AB25OIKYHEH52WGD6G3H3TDRGR3BHA5CNFSM4LEBEMOKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4ITOOCEA, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB25OIIEJHALWF5E4KZQGH3RGR3BHANCNFSM4LEBEMOA .

amcilwee commented 4 years ago

Thanks Gilles. Anytime you get the chance would be great. It’s a fantastic package you’ve developed.

Cheers Allen

From: gdauby notifications@github.com Sent: Monday, 9 March 2020 4:25 PM To: gdauby/ConR ConR@noreply.github.com Cc: Allen McIlwee Allen.McIlwee@environment.nsw.gov.au; Author author@noreply.github.com Subject: Re: [gdauby/ConR] Trouble using a protected areas shapefile (#6)

Hi I am on the field with limited email access until 26th March. I try to look at this asap, perhaps before that date. Best regards Gilles

Le lun. 9 mars 2020 à 05:11, amcilwee notifications@github.com<mailto:notifications@github.com> a écrit :

Hi, I'd like to run IUCN.eval on fauna and flora species in New South Wales (Australia). I want to create maps and look at the status of species post the 2019-2020 bushfire season, so I am substituting a RFS fire extent map for National Park boundaries. The problem I have, is that no matter what shapefile I include - I get an error "Error in { : task 1 failed - "need finite 'ylim' values" when creating png maps, and "Error in { : task 1 failed - "figure margins too large" when creating pdf maps.

This only seems to happen when I the script hits a species that has records inside the fire-affected area.

I have attached a test file (frog records) and associated shapefiles. The settings I've applied are:

Results <- IUCN.eval(MyData, country_map = NSW_NPWS_Branch, Cell_size_AOO = 2, Cell_size_locations = 10, SubPop=TRUE, Resol_sub_pop = 5, method_locations = "fixed_grid", Rel_cell_size = 0.05, DrawMap = TRUE, add.legend = TRUE, file_name = NULL, export_shp = TRUE, write_shp = TRUE, write_results=TRUE, map_pdf = TRUE, draw.poly.EOO=TRUE, exclude.area = TRUE, method_protected_area = "other", protec.areas=NSW_RFS_FireExtent, ID_shape_PA = "FID_RFSfir", buff_width = 0.1, alpha=0.9, buff.alpha=0.1, method.range="alpha.hull", nbe.rep.rast.AOO=0, showWarnings=TRUE, write_file_option="csv", parallel=TRUE, NbeCores=12)

NSW_ConR_Test.zip https://github.com/gdauby/ConR/files/4304736/NSW_ConR_Test.zip

Cheers, Allen

PS. Is there a way I can change "number of protected areas" on the maps to "number of records in burnt area"

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gdauby/ConR/issues/6?email_source=notifications&email_token=AB25OIKYHEH52WGD6G3H3TDRGR3BHA5CNFSM4LEBEMOKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4ITOOCEA, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB25OIIEJHALWF5E4KZQGH3RGR3BHANCNFSM4LEBEMOA .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/gdauby/ConR/issues/6?email_source=notifications&email_token=AE2DN2L6FLWW6QQNWQZBO6DRGR4TXA5CNFSM4LEBEMOKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOFWGUY#issuecomment-596337491, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AE2DN2LP4EMQEL6NJG7UVLDRGR4TXANCNFSM4LEBEMOA.

This email is intended for the addressee(s) named and may contain confidential and/or privileged information. If you are not the intended recipient, please notify the sender and then delete it immediately. Any views expressed in this email are those of the individual sender except where the sender expressly and with authority states them to be the views of the NSW Office of Environment and Heritage.

PLEASE CONSIDER THE ENVIRONMENT BEFORE PRINTING THIS EMAIL

amcilwee commented 4 years ago

Hi Gilles, just wondering if you had a chance to look at the test files and resolve the error issue? This would greatly assist me. cheers Allen.

gdauby commented 4 years ago

Hi could you install the development version and test it? devtools::install_github("gdauby/ConR") Tks I do not recommand you to use map_pdf = TRUE for such a large dataset.

gdauby commented 4 years ago

Try:

Results <- IUCN.eval(MyData,
country_map = NSW_NPWS_Branch,
Cell_size_AOO = 2,
Cell_size_locations = 10,
SubPop=TRUE,
Resol_sub_pop = 5,
method_locations = "fixed_grid",
Rel_cell_size = 0.05,
DrawMap = TRUE,
add.legend = TRUE,
file_name = NULL,
export_shp = TRUE,
write_shp = TRUE,
write_results=TRUE,
map_pdf = FALSE,
draw.poly.EOO=TRUE,
exclude.area = TRUE,
method_protected_area = "other",
protec.areas=NSW_RFS_FireExtent,
ID_shape_PA = "FID_RFSfir",
buff_width = 0.1,
alpha=0.9,
buff.alpha=0.1,
method.range="alpha.hull",
nbe.rep.rast.AOO=0,
showWarnings=TRUE,
write_file_option="csv",
parallel=TRUE,
NbeCores=4)
gdauby commented 4 years ago

The new version now on CRAN should be fine.

amcilwee commented 4 years ago

Thanks so much for this, will be looking at it today.

From: gdauby notifications@github.com Sent: Tuesday, 19 May 2020 1:24 AM To: gdauby/ConR ConR@noreply.github.com Cc: Allen McIlwee Allen.McIlwee@environment.nsw.gov.au; Author author@noreply.github.com Subject: Re: [gdauby/ConR] Trouble using a protected areas shapefile (#6)

The new version now on CRAN should be fine.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/gdauby/ConR/issues/6#issuecomment-630256025, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AE2DN2IZKM3JTEAIVOAC5N3RSFHJJANCNFSM4LEBEMOA.

This email is intended for the addressee(s) named and may contain confidential and/or privileged information. If you are not the intended recipient, please notify the sender and then delete it immediately. Any views expressed in this email are those of the individual sender except where the sender expressly and with authority states them to be the views of the NSW Office of Environment and Heritage.

PLEASE CONSIDER THE ENVIRONMENT BEFORE PRINTING THIS EMAIL