-
This is a tiny patch release with no user-facing changes.
-
Added
\alias{geojsonio-package}
toman/geojsonio.rd
.
- Removed references to geojsonlint as that package nears retirement.
- SpatialPolygonsDataFrame inputs are now cast to sf before being written out to fix ring ordering. This was previously handled by maptools, which is being retired. Outputs are visually identical, but underlying representations may have changed.
- Functions relying on rgeos (such as those writing rgeos objects to file) are defunct. PRs to replace these using the newer geos package are welcomed.
topojson_write()
has been restored, and now supports conversion to topoJSON formats. User reports indicate output files might be larger than anticipated; PRs to address this are welcomed. Huge thanks to @Shaunson26 for this PR!
- The rgeos and maptools packages have been removed from Imports. (Thanks to Roger Bivand and Mike Sumner on Mastodon!)
- Deprecated (with a warning) functions relying on rgeos. These will stop working in 2023.
- Tests have been updated to use testthat 3e, plus a number of other improvements around isolating tests and improving test quality. HUGE thanks to @czeildi for tackling this in two massive PRs (#187, #186, #183).
- fix for
sprintf()
usage within theprojections()
function; only run sprintf on a particular string if it has length > 0 (#172) - fix for
as.json()
when the input is the output oftopojson_list()
- we weren't constructing the TopoJSON arcs correctly (#160) - fix to
geojson_read()
: now using packagegeojsonsf
to read geojson (#163)
- fix a test for change in
stringsAsFactors
behavior in R v4 (#166) (#167) - temporarily make
topojson_write()
defunct until we can sort out issues with new sf version (#168)
geojson_sf()
andgeojson_sp()
now accept strings in addition tojson
,geoson_list
andgeojson_json
types (#164)
topojson_json()
andtopojson_list()
gain paramsobject_name
andquantization
to pass through togeojson_json()
(#158)- replace httr with crul (#105)
- rgdal replaced with sf throughout the package; all
writeOGR
replaced withst_write
andreadOGR
withst_read
; this should not create any user facing changes, but please let us know if you have problems with this version (#41) (#150) (#157)
geojson_read()
gains new S3 methodgeojson_read.PqConnection
for connecting to a PostgreSQL database set up with PostGIS. See also?postgis
for notes on Postgis installation, and setting up some simple data in Postgis from this package (#61) (#155) thanks to @fxi
geojson_read()
instead of going through packagesp
now goes through packagesf
for a significant speed up, see ropensci#136 (comment) (#136)geojson_list()
gains parameterprecision
to adjust number of decimal places used. only applies to classes from packages sp and rgeos (#152) (related to #141) thanks to @ChrisJones687- improve dependency installation notes in README (#149) (#151) thanks @setgree and @nickto
- move to using markdown docs
file_to_geojson()
now using https protocol instead of http for the online ogre service called when usingmethod = "web"
- fix
geojson_read()
to fail better when usingmethod="web"
; and update docs to note thatmethod="web"
can result if file size issues, butmethod="local"
should not have such issues (#153) - change name of
print.location
method to not conflict withdplyr
(#154)
geo2topo()
gains a new parameterquantization
to quantize geometry prior to computing topology. becausetopojson_write()
usesgeo2topo()
internally,topojson_write()
also gains aquantization
parameter that's passed togeo2topo()
internally (#138) thanks @pvictor
- use package
sf
instead ofsp
intopojson_read()
. note that the return object is now class sf instead of classes from the sp package (#144) (#145) - the
type
parameter intopojson_json()
now set totype="auto"
if the input is an sf/sfc/sfg class object (#139) (#146) - fix to
geojson_list.sfc()
for changes in sf >= v0.7, which names geometries, but that's not valid geojson (#142)
- The two linting functions in this package,
lint()
andvalidate()
are now defunct. They have been marked as deprecated sincev0.2
. See the packagegeojsonlint
on CRAN for linting geojson functionality (#135) (#147)
topojson_write()
gains a new parameterobject_name
. With it you can set the name for the resulting TopoJSON object name created. As part of thisgeo2topo()
also gains a new parameter, similarly calledobject_name
, that does the same thing as fortopojson_write()
. (#129) (thanks @josiekre) PR (#131)- As part of PR (#132) we added a new function
geojson_sf()
to convert output ofgeojson_list()
orgeojson_json()
tosf
package classes - as an analog togeojson_sp()
geojson_json()
gains option with thetype
parameter to skip a coercion to thegeojson
package classgeoclass
. Usingtype = "skip"
you can skip thegeoclass
class coercion, which in some cases with large datasets should have performance improvements (#128) PR (#133)
- A bug arose in
geojson_sp()
with the newest version ofrgdal
. This was resolved by using thesf
package instead to read GeoJSON. This had a knock-on benefit of speeding up reading GeoJSON. In addition,sf
is now inImports
instead ofSuggests
(#130) PR (#132)
- gains new function
geojson_atomize
to "atomize" a FeatureCollection into its features, or a GeometryCollection into its geometries (#120) via (#119) thx @SymbolixAU - gains new functions
topojson_list
andtopojson_json
for converting many input types with spatial data to TopoJSON, both as lists and as JSON (#117) geojson_json
uses brief output provided by thegeojson
package - this makes it less frustrating when you have an especially large geojson string that prints to console - this instead prints a brief summary of the GeoJSON object (#86) (#124)
- doing a much more thorough job of cleaning up temp files that are necessarily generated due to having to go to disk sometimes (#122)
- @ateucher made improvements to
geojson_json
to maketype
parameter more flexible (#125)
- Fixe bug in
topojson_write
- we were writing topojson file, but also a geojson file - we now cleanup the geojson file (#127)
- Fix package so that we load
topojson-server.js
from within the package instead of from the web. This makes it so that the package doesn’t make any web requests on load, which prevented package from loading when no internet connection available. (#118)
- Gains new functions
geo2topo
,topo2geo
,topojson_write
, andtopojson_read
for working with TopoJSON data - associated with this, we now importgeojson
package (#24) (#100)
- Updated vignette with details on the GeoJSON specification to the new specification at https://www.rfc-editor.org/rfc/rfc7946 (#114)
geojson_write
andgeojson_json
now pass...
argument through torgdal::writeOGR
orjsonlite::toJSON
depending on the class/method. For those methods that use the latter, this now allows setting of thena
argument to control howNA
values are represented in json, and thepretty
argument to control whether or the resulting json is pretty-formated or compact (#109) (#111)- Spelling/grammar fixes, thanks @patperu ! (#106)
geojson_json
andgeojson_write
now convert unsupported classes to their basic class before conversion and/or writing to geojson. This was most commonly occurring with fields insf
objects calculated bysf::st_area
andsf::st_length
which were of classunits
. (#107)- Fixed a bug occurring with
GDAL
version >= 2.2.0 where the layer name in a geojson file was not detected properly (#108)
- Fix to tests for internal fxn
convert_wgs84
to do minimal test of output, and to conditionally test only ifsf
is available (#103)
geojson_json
,geojson_list
, andgeojson_write
gain new S3 methods:sf
,sfc
, andsfg
- the three classes in thesf
package (#95)geojson_json
,geojson_list
, andgeojson_write
gain two new parameters each:convert_wgs84
(boolean) to convert to WGS84 or not (the projection assumed for GeoJSON) andcrs
to assign a CRS if known (#101) (#102)
geojson_json()
for non-sp classes now only keeps seven decimal places in the coordinates. This follows the default that GDAL uses.- Now namespacing base package calls for
methods
/stats
/utils
instead of importing them - Improved documentation for
method
parameter ingeojson_read
clarifying what the options are for (#93) thanks @bhaskarvk - Internal fxn
to_json
now defaults to 7 digits, which is used inas.json
andgeojson_json
(#96)
- Fix to
geojson_read
to read correctly from a URL - in addition to file paths (#91) (#92) thanks @lecy - Fix to
geojson_read
to read non-.geojson
extensions (#93) thanks @bhaskarvk
- Major performance improvement for
geojson_json()
- moved to reading in json withreadr::read_file()
(#85) thanks @javrucebo ! - Now requiring explicit versions of some package dependencies
- Removed the startup message
- Changed
file_to_geojson()
to usehttr::write_disk()
instead ofdownload.file()
(#83) thanks @patperu
- The two linting functions in this package,
lint()
andvalidate()
are now deprecated, and will be defunct in the next version of this package. See the new packagegeojsonlint
on CRAN for linting geojson functionality (#82)
- New method
geojson_sp.json()
added togeojson_sp()
to handle json class inputs
- Added
encodin="UTF-8"
tohttr::content()
calls
geojson_write()
didn't overwrite existing files despite saying so. New parameter added to the functionoverwrite
to specify whether to overwrite a function or not, which defaults toTRUE
(#81) thanks @Robinlovelace !
- New function
geojson_sp()
to convert output ofgeojson_list()
orgeojson_json()
to spatial classes (e.g.,SpatialPointsDataFrame
) (#71)
- Startup message added to notify users to ideally update to
rgdal > v1.1-1
given fix to make writing multipolygon objects to geojson correct (#69) - Filled out test suite more (#46)
- Fix to
lint()
function, due to bug in passing data to the Javascript layer (#73) - Fixes to
as.json()
(#76)
- New function
map_leaf()
uses theleaflet
package to make maps, with S3 methods for most spatial classes as well as most R classes, including data.frame's, lists, vectors, file inputs, and more (#48) geojson_read()
now optionally can give back a spatial class object, just a convenience in case you want to not get back geojson, but a spatial class (#60)
- Now that
leaflet
R package is on CRAN, put back in examples using it to make maps (#49) - Added a linter for list inputs comined with
geometry="polygon"
to allgeojson_*()
functions that have.list
methods. This checks to make sure inputs have the same first and last coordinate pairs to close the polygon (#34)
- Importing all non-base R funtions, including from
methods
,stats
andutils
packages (#62) - Fixed bug in
geojson_write()
in which geojson style names were altered on accident (#56)
- released to CRAN