Git Product home page Git Product logo

geoscript.scala's People

Contributors

aaime avatar dwins avatar hermanbanken avatar jericks avatar sbenthall avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

geoscript.scala's Issues

"lint" for CSS

Since CSS is kind of loose syntax-wise it would be good to have a way to list "off" use of the CSS language when creating styles - things like invalid color names, invalid property names, etc. Ideally we could give a list of this kind of problem with locations in the style source so that users can track down issues.

xml-apis-xerces-2.7.1

There is a problem to find xml-apis-xerces-2.7.1 library when building geoscript.

[info] Set current project to default-26d4ba (in build file:/discolocal/roberto/scala/geoscript.scala/geoscript/)

update
[info] Updating {file:/discolocal/roberto/scala/geoscript.scala/geoscript/}default-26d4ba...
[error] OSGeo: bad module name found in http://download.osgeo.org/webdav/geotools/xml-apis/xml-apis-xerces/2.7.1/xml-apis-xerces-2.7.1.pom: expected='xml-apis-xerces found='xml-apis'
[error] OSGeo: bad revision found in http://download.osgeo.org/webdav/geotools/xml-apis/xml-apis-xerces/2.7.1/xml-apis-xerces-2.7.1.pom: expected='2.7.1 found='xerces-2.7.1'
[error] OpenGeo: bad module name found in http://repo.opengeo.org/xml-apis/xml-apis-xerces/2.7.1/xml-apis-xerces-2.7.1.pom: expected='xml-apis-xerces found='xml-apis'
[error] OpenGeo: bad revision found in http://repo.opengeo.org/xml-apis/xml-apis-xerces/2.7.1/xml-apis-xerces-2.7.1.pom: expected='2.7.1 found='xerces-2.7.1'
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: xml-apis#xml-apis-xerces;2.7.1: several problems occurred while resolving dependency: xml-apis#xml-apis-xerces;2.7.1 {compile=[compile(), master()], runtime=[runtime()]}:
[warn] java.text.ParseException: inconsistent module descriptor file found in 'http://download.osgeo.org/webdav/geotools/xml-apis/xml-apis-xerces/2.7.1/xml-apis-xerces-2.7.1.pom': bad module name: expected='xml-apis-xerces' found='xml-apis'; bad revision: expected='2.7.1' found='xerces-2.7.1';
[warn] java.text.ParseException: inconsistent module descriptor file found in 'http://repo.opengeo.org/xml-apis/xml-apis-xerces/2.7.1/xml-apis-xerces-2.7.1.pom': bad module name: expected='xml-apis-xerces' found='xml-apis'; bad revision: expected='2.7.1' found='xerces-2.7.1';
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[info]
[error] :: problems summary ::
[warn] :::: WARNINGS
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: xml-apis#xml-apis-xerces;2.7.1: several problems occurred while resolving dependency: xml-apis#xml-apis-xerces;2.7.1 {compile=[compile(
), master()], runtime=[runtime()]}:
[warn] java.text.ParseException: inconsistent module descriptor file found in 'http://download.osgeo.org/webdav/geotools/xml-apis/xml-apis-xerces/2.7.1/xml-apis-xerces-2.7.1.pom': bad module name: expected='xml-apis-xerces' found='xml-apis'; bad revision: expected='2.7.1' found='xerces-2.7.1';
[warn] java.text.ParseException: inconsistent module descriptor file found in 'http://repo.opengeo.org/xml-apis/xml-apis-xerces/2.7.1/xml-apis-xerces-2.7.1.pom': bad module name: expected='xml-apis-xerces' found='xml-apis'; bad revision: expected='2.7.1' found='xerces-2.7.1';
[warn] ::::::::::::::::::::::::::::::::::::::::::::::

Use CSS defaults for symbolizers

Right now colors and sizes default to null, however SLD provides reasonable defaults, e.g., when setting a stroke width to 2 it would make sense to see a black line, not an empty map because the color has not been assigned.

Each symbolizer has basic, meaningful defaults in SLD, CSS should use those.

raster styling in css

Currently there is no way to get a RasterSymbolizer out of a CSS style; it would be good to have it for completeness.

Compilation error (not found: value Filter)

[info] Loading project definition from /Users/Shared/geoscript.scala/project/project
[info] Loading project definition from /Users/Shared/geoscript.scala/project
[info] Set current project to root (in build file:/Users/Shared/geoscript.scala/)

compile
[info] Compiling 18 Scala sources to /Users/Shared/geoscript.scala/geoscript/target/scala-2.10/classes...
[error] /Users/Shared/geoscript.scala/geoscript/src/main/scala/layer/Layer.scala:101: not found: value Filter
[error] exclude(Filter.id(
[error] ^
[error] one error found
error Compilation failed
[error] Total time: 10 s, completed Dec 29, 2013 8:09:41 PM

less css functionality

Bring in some concepts from LESS CSS like variables, mix-ins, and nested rules to bring the level of concision up a notch and bring us a little closer to Carto-friendliness.

Create binary builds

Currently, 'sbt package' only produces a JAR with geoscript's own libraries. In order to make it easy for folks to get started using geoscript, let's add a release artifact that consists of all the jars needed to make geoscript work.

Wrong reference to xml-apis-xerces

With a fresh clone of geoscript.scala, and a clean Ivy2 cache (rm -rf ~/.ivy2), I get an error while compiling (and running the examples project):

[error] OSGeo: bad module name found in http://download.osgeo.org/webdav/geotools/xml-apis/xml-apis-xerces/2.7.1/xml-apis-xerces-2.7.1.pom: expected='xml-apis-xerces found='xml-apis'
[error] OSGeo: bad revision found in http://download.osgeo.org/webdav/geotools/xml-apis/xml-apis-xerces/2.7.1/xml-apis-xerces-2.7.1.pom: expected='2.7.1 found='xerces-2.7.1'
[error] OpenGeo: bad module name found in http://repo.opengeo.org/xml-apis/xml-apis-xerces/2.7.1/xml-apis-xerces-2.7.1.pom: expected='xml-apis-xerces found='xml-apis'
[error] OpenGeo: bad revision found in http://repo.opengeo.org/xml-apis/xml-apis-xerces/2.7.1/xml-apis-xerces-2.7.1.pom: expected='2.7.1 found='xerces-2.7.1'
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: xml-apis#xml-apis-xerces;2.7.1: several problems occurred while resolving dependency: xml-apis#xml-apis-xerces;2.7.1 {compile=[compile(), master()], runtime=[runtime(*)]}:
[warn] java.text.ParseException: inconsistent module descriptor file found in 'http://download.osgeo.org/webdav/geotools/xml-apis/xml-apis-xerces/2.7.1/xml-apis-xerces-2.7.1.pom': bad module name: expected='xml-apis-xerces' found='xml-apis'; bad revision: expected='2.7.1' found='xerces-2.7.1';
[warn] java.text.ParseException: inconsistent module descriptor file found in 'http://repo.opengeo.org/xml-apis/xml-apis-xerces/2.7.1/xml-apis-xerces-2.7.1.pom': bad module name: expected='xml-apis-xerces' found='xml-apis'; bad revision: expected='2.7.1' found='xerces-2.7.1';
[warn] ::::::::::::::::::::::::::::::::::::::::::::::

Publish geoscript.scala to Maven

It should be possible to include geoscript in the libraryDependencies in build.sbt as opposed to a manual download and custom install.

serializable

Features, geometries, and feature collections should be serializable as json, kml and gml object.

dwins' suggestion:

import org.geoscript._
import geometry.writer._

val p = geometry.Point(1, 2)
val json = p as JSON // from geometry.writer

Envelopes are not wrapped

JTS Envelopes (and GeoTools ReferencedEnvelopes) are not wrapped in geoscript.scala. We should sugar them up to be treatable as regular Geometries, supporting reprojection, etc, but with extra Envelope-specific operations such as 'expand to include.'

CSS2SLD Multiple issues

Hi,

I am trying to convert OpenStreetMap styles from CartoCSS to GeoServer CSS. But the CSS2SLD converter has strange behaviors. It introduces unexpected rules and it doesn't respect the filters as written. Take this exemple in the bottom of this message. If you look carefully at the generated SLD, the converter has introduces the following errors :

  1. It has inserted an extra condition on "way_area" for "[@scale < 4000]"
  2. It has inserted an extra "MinScaleDenominator" for "[way_area > 19999] [@scale < 8000]"
  3. It has inserted an extra "MinScaleDenominator" for "[way_area > 79999] [@scale < 15000]"
  4. It has inserted an extra "MinScaleDenominator" for "[way_area > 149999] [@scale < 35000]"
  5. It has inserted an extra rule for "[@scale < 4000]"

Could you please fix CSS2SLD in a way it respects provided CSS more accurately ? Because I'm currently blocked. The only exit I have is to abort CSS and use SLD directly, what I want to avoid. Thanks alot.

CartoCSS
[way_area >= 150000][zoom >= 14],
[way_area >= 80000][zoom >= 15],
[way_area >= 20000][zoom >= 16],
[zoom >= 17] {
text-name: "[name]";
text-size: 11;
text-fill: #444;
text-face-name: @book-fonts;
text-halo-radius: 1;
text-wrap-width: 20;
text-halo-fill: rgba(255,255,255,0.5);
text-placement: interior;
}

GeoServer CSS :

[way_area > 149999] [@scale < 35000],
[way_area > 79999] [@scale < 15000],
[way_area > 19999] [@scale < 8000],
[@scale < 4000] {
label: [name];
font-family: "DejaVu Sans Book";
font-size: 11;
font-fill: #444;
halo-radius: 1;
halo-color: #FFF;
halo-opacity: 0.5;
}

Generated SLD :

sld:NameDefault Styler/sld:Name
sld:FeatureTypeStyle
sld:Namename/sld:Name
sld:Rule
ogc:Filter
ogc:PropertyIsGreaterThan
ogc:PropertyNameway_area/ogc:PropertyName
ogc:Literal19999/ogc:Literal
/ogc:PropertyIsGreaterThan
/ogc:Filter
sld:MaxScaleDenominator4000.0/sld:MaxScaleDenominator
sld:TextSymbolizer
sld:Label
ogc:PropertyNamename/ogc:PropertyName
/sld:Label
sld:Font
<sld:CssParameter name="font-family">DejaVu Sans Book/sld:CssParameter
<sld:CssParameter name="font-size">11/sld:CssParameter
<sld:CssParameter name="font-style">normal/sld:CssParameter
<sld:CssParameter name="font-weight">normal/sld:CssParameter
/sld:Font
sld:Halo
sld:Radius1/sld:Radius
sld:Fill
<sld:CssParameter name="fill">#FFFFFF/sld:CssParameter
<sld:CssParameter name="fill-opacity">0.5/sld:CssParameter
/sld:Fill
/sld:Halo
sld:Fill
<sld:CssParameter name="fill">#444444/sld:CssParameter
/sld:Fill
/sld:TextSymbolizer
/sld:Rule
sld:Rule
ogc:Filter
ogc:PropertyIsGreaterThan
ogc:PropertyNameway_area/ogc:PropertyName
ogc:Literal19999/ogc:Literal
/ogc:PropertyIsGreaterThan
/ogc:Filter
sld:MinScaleDenominator4000.0/sld:MinScaleDenominator
sld:MaxScaleDenominator8000.0/sld:MaxScaleDenominator
sld:TextSymbolizer
sld:Label
ogc:PropertyNamename/ogc:PropertyName
/sld:Label
sld:Font
<sld:CssParameter name="font-family">DejaVu Sans Book/sld:CssParameter
<sld:CssParameter name="font-size">11/sld:CssParameter
<sld:CssParameter name="font-style">normal/sld:CssParameter
<sld:CssParameter name="font-weight">normal/sld:CssParameter
/sld:Font
sld:Halo
sld:Radius1/sld:Radius
sld:Fill
<sld:CssParameter name="fill">#FFFFFF/sld:CssParameter
<sld:CssParameter name="fill-opacity">0.5/sld:CssParameter
/sld:Fill
/sld:Halo
sld:Fill
<sld:CssParameter name="fill">#444444/sld:CssParameter
/sld:Fill
/sld:TextSymbolizer
/sld:Rule
sld:Rule
ogc:Filter
ogc:PropertyIsGreaterThan
ogc:PropertyNameway_area/ogc:PropertyName
ogc:Literal79999/ogc:Literal
/ogc:PropertyIsGreaterThan
/ogc:Filter
sld:MinScaleDenominator8000.0/sld:MinScaleDenominator
sld:MaxScaleDenominator15000.0/sld:MaxScaleDenominator
sld:TextSymbolizer
sld:Label
ogc:PropertyNamename/ogc:PropertyName
/sld:Label
sld:Font
<sld:CssParameter name="font-family">DejaVu Sans Book/sld:CssParameter
<sld:CssParameter name="font-size">11/sld:CssParameter
<sld:CssParameter name="font-style">normal/sld:CssParameter
<sld:CssParameter name="font-weight">normal/sld:CssParameter
/sld:Font
sld:Halo
sld:Radius1/sld:Radius
sld:Fill
<sld:CssParameter name="fill">#FFFFFF/sld:CssParameter
<sld:CssParameter name="fill-opacity">0.5/sld:CssParameter
/sld:Fill
/sld:Halo
sld:Fill
<sld:CssParameter name="fill">#444444/sld:CssParameter
/sld:Fill
/sld:TextSymbolizer
/sld:Rule
sld:Rule
ogc:Filter
ogc:PropertyIsGreaterThan
ogc:PropertyNameway_area/ogc:PropertyName
ogc:Literal149999/ogc:Literal
/ogc:PropertyIsGreaterThan
/ogc:Filter
sld:MinScaleDenominator15000.0/sld:MinScaleDenominator
sld:MaxScaleDenominator35000.0/sld:MaxScaleDenominator
sld:TextSymbolizer
sld:Label
ogc:PropertyNamename/ogc:PropertyName
/sld:Label
sld:Font
<sld:CssParameter name="font-family">DejaVu Sans Book/sld:CssParameter
<sld:CssParameter name="font-size">11/sld:CssParameter
<sld:CssParameter name="font-style">normal/sld:CssParameter
<sld:CssParameter name="font-weight">normal/sld:CssParameter
/sld:Font
sld:Halo
sld:Radius1/sld:Radius
sld:Fill
<sld:CssParameter name="fill">#FFFFFF/sld:CssParameter
<sld:CssParameter name="fill-opacity">0.5/sld:CssParameter
/sld:Fill
/sld:Halo
sld:Fill
<sld:CssParameter name="fill">#444444/sld:CssParameter
/sld:Fill
/sld:TextSymbolizer
/sld:Rule
sld:Rule
ogc:Filter
ogc:Not
ogc:PropertyIsGreaterThan
ogc:PropertyNameway_area/ogc:PropertyName
ogc:Literal19999/ogc:Literal
/ogc:PropertyIsGreaterThan
/ogc:Not
/ogc:Filter
sld:MaxScaleDenominator4000.0/sld:MaxScaleDenominator
sld:TextSymbolizer
sld:Label
ogc:PropertyNamename/ogc:PropertyName
/sld:Label
sld:Font
<sld:CssParameter name="font-family">DejaVu Sans Book/sld:CssParameter
<sld:CssParameter name="font-size">11/sld:CssParameter
<sld:CssParameter name="font-style">normal/sld:CssParameter
<sld:CssParameter name="font-weight">normal/sld:CssParameter
/sld:Font
sld:Halo
sld:Radius1/sld:Radius
sld:Fill
<sld:CssParameter name="fill">#FFFFFF/sld:CssParameter
<sld:CssParameter name="fill-opacity">0.5/sld:CssParameter
/sld:Fill
/sld:Halo
sld:Fill
<sld:CssParameter name="fill">#444444/sld:CssParameter
/sld:Fill
/sld:TextSymbolizer
/sld:Rule
/sld:FeatureTypeStyle
/sld:UserStyle

GeoServer Rendering transformations in CSS

GeoServer has a cool feature where you can use a WPS Process to modify data arbitrarily on the fly as part of your style. It would be awesome to support it in CSS. The render-transformations branch is basically ready to go but since GeoTools currently ignores the relevant property when serializing styles it doesn't work well.

long comments cause stack overflow

A CSS file like this causes a stack overflow:

*{
    fill:#B23232;
}

/*
........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
*/

but one character less is okay.

The exception is:

Exception in thread "main" java.lang.StackOverflowError
    at java.util.regex.Pattern$CharProperty.match(Unknown Source)
    at java.util.regex.Pattern$Branch.match(Unknown Source)
    at java.util.regex.Pattern$GroupHead.match(Unknown Source)
    at java.util.regex.Pattern$Loop.match(Unknown Source)
    at java.util.regex.Pattern$GroupTail.match(Unknown Source)
    at java.util.regex.Pattern$BranchConn.match(Unknown Source)
    at java.util.regex.Pattern$CharProperty.match(Unknown Source)
    at java.util.regex.Pattern$Branch.match(Unknown Source)
    at java.util.regex.Pattern$GroupHead.match(Unknown Source)
    at java.util.regex.Pattern$Loop.match(Unknown Source)
    at java.util.regex.Pattern$GroupTail.match(Unknown Source)
    at java.util.regex.Pattern$BranchConn.match(Unknown Source)
    at java.util.regex.Pattern$CharProperty.match(Unknown Source)
    at java.util.regex.Pattern$Branch.match(Unknown Source)
    ...

Problem with ivy checksum for jgridshift

When making sbt test the following error appears

problem while downloading module descriptor: http://download.osgeo.org/webdav/geotools/jgridshift/jgridshift/1.0/jgridshift-1.0.pom: invalid sha1: expected=b1368a983af519d0e6ecd8dcbfee651016501f0d computed=88f8cf93af6666f7378131236f8227e48344fed2 (362ms)

Any guidance on how to make this library compile would be greatly appreciated. Thanks in advance

label-anchor property ignored if label-offset is not specified

This style creates an SLD with no AnchorPoint, but probably should:

* {
  label: [foo];
  label-anchor: 0.75 0.75;
}

There is a bit of a conflict with 'label-offset' since it may produce a LinePlacement instead of a PointPlacement. I think when label-offset indicates a LinePlacement and label-anchor indicates a PointPlacement we should generate a LinePlacement.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.