Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GeometryAttributeImpl cannot be cast to com.vividsolutions.jts.geom.Geometry #2

Open
carrbrpoa opened this issue Dec 26, 2016 · 0 comments

Comments

@carrbrpoa
Copy link

carrbrpoa commented Dec 26, 2016

Hello,

I tried a GET for GetFeature in a layer published from MongoDB store and got the following error:

<ows:ExceptionReport version="2.0.0" xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://mylocalgeoserver:8080/geoserver/schemas/ows/1.1.0/owsAll.xsd">
<ows:Exception exceptionCode="NoApplicableCode">
<ows:ExceptionText>java.lang.ClassCastException: org.geotools.feature.GeometryAttributeImpl cannot be cast to com.vividsolutions.jts.geom.Geometry org.geotools.feature.GeometryAttributeImpl cannot be cast to com.vividsolutions.jts.geom.Geometry</ows:ExceptionText>
</ows:Exception>
</ows:ExceptionReport>

It even happens if I try Layer Preview in GeoServer, asking for GeoJSON.

Here's my mapping:

[{
		"typeName": "occurrence",
		"collection": "occurrences",
		"idAsAttribute": true,
		"geometry": {
			"name": "location",
			"crs": "EPSG:4326",
			"path": "location"
		},
		"displayGeometry": true,
		"attributes": [{
				"name": "type",
				"path": "type"
			}, {
				"name": "description",
				"path": "description"
			}, {
				"name": "status",
				"path": "status"
			}
		]
	}
]

and an item sample:

{
	type: "Some type",
	location: {
		type: "Point",
		coordinates: [-51.216039, -30.047548]
	},
	description: "Some description"
}

If I ask Layer Preview with format GML 2.0, it seems to work:

<wfs:FeatureCollection xmlns="http://www.opengis.net/wfs" xmlns:wfs="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:mongo="mongo" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://mylocalgeoserver:8080/geoserver/schemas/wfs/1.0.0/WFS-basic.xsd mongo http://mylocalgeoserver:8080/geoserver/mongo/wfs?service=WFS&version=1.0.0&request=DescribeFeatureType&typeName=mongo%3Aoccurrence">
<gml:boundedBy>
<gml:null>unknown</gml:null>
</gml:boundedBy>
<gml:featureMember>
<mongo:occurrence fid="fid--641acbe7_1593bdeffad_-7b2c">
<mongo:location>
GeometryAttributeImpl:location<location crs=GEOGCS["WGS 84", DATUM["World Geodetic System 1984", SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]], AUTHORITY["EPSG","6326"]], PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], UNIT["degree", 0.017453292519943295], AXIS["Geodetic longitude", EAST], AXIS["Geodetic latitude", NORTH], AUTHORITY["EPSG","4326"]]>=POINT (-51.216039 -30.047548)
</mongo:location>
<mongo:type>Some type</mongo:type>
<mongo:description>
Some description
</mongo:description>
</mongo:occurrence>
</gml:featureMember>
</wfs:FeatureCollection>

My GeoServer is version 2.7.2.

Any ideas?

Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant