cadastral_references: Cadastral references test data

cadastral_referencesR Documentation

Cadastral references test data

Description

Randomly selected data from catastro to test geocode_cadastral function

Usage

data(cadastral_references)

Format

A data frame.

Source

Sede Electrónica del Catastro

References

Catastro. Ministerio de Hacienda y función pública. (Catastro)

Examples

## source is cadastral reference number ##

geocode_cadastral("0636105UF3403N", parse_files = FALSE)

## Use lapply to geocode cadastral references from dataframe columns.

cadastral_references$new <- lapply(cadastral_references$cadref1, geocode_cadastral)

## separate previously generated "new" data into columns usign tidyr

library(tidyr)
separate(cadastral_references, new, into = c('longitude','latitude'), sep = "," )

## source is folder. A loop is needed to process each kml file ##

## Not run: 
files <- list.files("folder", full.names = T)

for (f in files) {
 coords <- geocode_cadastral(f, parse_files = TRUE)
 d <- as.data.frame(rbind(d , as.data.frame(coords, stringsAsFactors = F )))
}

# separate lat/lon into columns if you prefer using tidyr
d <- tidyr::separate(coords, into = c("longitude","latitude"), sep = "," )

## End(Not run)

verajosemanuel/ESmisc documentation built on Jan. 4, 2023, 12:37 p.m.