diff --git a/REQUIRE b/REQUIRE index 94237c0..9f97461 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1 +1,2 @@ julia 0.5 +Compat 0.17 diff --git a/src/GeoInterface.jl b/src/GeoInterface.jl index edae629..74fccff 100644 --- a/src/GeoInterface.jl +++ b/src/GeoInterface.jl @@ -2,6 +2,8 @@ __precompile__() module GeoInterface + using Compat + export AbstractPosition, Position, AbstractGeometry, AbstractGeometryCollection, GeometryCollection, AbstractPoint, Point, @@ -20,7 +22,7 @@ module GeoInterface geometry, bbox, crs, properties, features - abstract AbstractPosition{T <: Real} <: AbstractVector{T} + @compat abstract type AbstractPosition{T <: Real} <: AbstractVector{T} end geotype(::AbstractPosition) = :Position xcoord(::AbstractPosition) = error("xcoord(::AbstractPosition) not defined.") ycoord(::AbstractPosition) = error("ycoord(::AbstractPosition) not defined.") @@ -38,32 +40,32 @@ module GeoInterface Base.convert(::Type{Vector{Float64}}, p::AbstractPosition) = coordinates(p) # Base.linearindexing{T <: AbstractPosition}(::Type{T}) = LinearFast() - abstract AbstractGeometry + @compat abstract type AbstractGeometry end coordinates(obj::AbstractGeometry) = error("coordinates(::AbstractGeometry) not defined.") - abstract AbstractPoint <: AbstractGeometry + @compat abstract type AbstractPoint <: AbstractGeometry end geotype(::AbstractPoint) = :Point - abstract AbstractMultiPoint <: AbstractGeometry + @compat abstract type AbstractMultiPoint <: AbstractGeometry end geotype(::AbstractMultiPoint) = :MultiPoint - abstract AbstractLineString <: AbstractGeometry + @compat abstract type AbstractLineString <: AbstractGeometry end geotype(::AbstractLineString) = :LineString - abstract AbstractMultiLineString <: AbstractGeometry + @compat abstract type AbstractMultiLineString <: AbstractGeometry end geotype(::AbstractMultiLineString) = :MultiLineString - abstract AbstractPolygon <: AbstractGeometry + @compat abstract type AbstractPolygon <: AbstractGeometry end geotype(::AbstractPolygon) = :Polygon - abstract AbstractMultiPolygon <: AbstractGeometry + @compat abstract type AbstractMultiPolygon <: AbstractGeometry end geotype(::AbstractMultiPolygon) = :MultiPolygon - abstract AbstractGeometryCollection <: AbstractGeometry + @compat abstract type AbstractGeometryCollection <: AbstractGeometry end geotype(::AbstractGeometryCollection) = :GeometryCollection geometries(obj::AbstractGeometryCollection) = error("geometries(::AbstractGeometryCollection) not defined.") - abstract AbstractFeature + @compat abstract type AbstractFeature end geotype(::AbstractFeature) = :Feature geometry(obj::AbstractFeature) = error("geometry(::AbstractFeature) not defined.") # optional @@ -71,7 +73,7 @@ module GeoInterface bbox(obj::AbstractFeature) = nothing crs(obj::AbstractFeature) = nothing - abstract AbstractFeatureCollection + @compat abstract type AbstractFeatureCollection end geotype(::AbstractFeatureCollection) = :FeatureCollection features(obj::AbstractFeatureCollection) = error("features(::AbstractFeatureCollection) not defined.") # optional diff --git a/src/geotypes.jl b/src/geotypes.jl index 749cbe8..ef982f7 100644 --- a/src/geotypes.jl +++ b/src/geotypes.jl @@ -1,7 +1,7 @@ # Coordinate Reference System Objects # (has keys "type" and "properties") # TODO: Handle full CRS spec -typealias CRS Dict{String,Any} +const CRS = Dict{String,Any} # Bounding Boxes # The value of the bbox member must be a 2*n array, @@ -11,9 +11,9 @@ typealias CRS Dict{String,Any} # The axes order of a bbox follows the axes order of geometries. # In addition, the coordinate reference system for the bbox is assumed to match # the coordinate reference system of the GeoJSON object of which it is a member. -typealias BBox Vector{Float64} +const BBox = Vector{Float64} -typealias Position Vector{Float64} +const Position = Vector{Float64} # (x, y, [z, ...]) - meaning of additional elements undefined. # In an object's contained geometries, Positions must have uniform dimensions. geotype(::Position) = :Position