0

I'd like to persist a set of Geometries in the database. Afterwards I'd like to query all Documents whose geometries intersect a given Point via Doctrine ODM.

Somehow I have no idea how to create the document-schema via doctrine. I tried several Annotation-Types (see below) to define a geometry-field but either doctrine throws errors at schema:update or the fieldis not being interpreted as Geometry so that I can't query via $queryBuilder->field('geometry')->geointersects($somePoint).

I tried to use these following annotations, but none of them worked as I wanted them to.

@ODM\embedOne(targetDocument=Polygon::class) //from jmikola/GeoJson -> schema-error
$geometry

// or //

@ODM\embedOne(targetDocument=Geometry::class) //own class -> query has no results
$geometry

// or //

@ODM\Field(name="Polygon",type="raw") //array-notation -> illegal type conversion in query
$geometry

// and several others...
malarzm
  • 2,831
  • 2
  • 15
  • 25
Joh W.
  • 48
  • 1
  • 6

1 Answers1

0

okay, the one whith an own embedded class worked. I just messed up the query (wrong conversion from kilometers radians).

Joh W.
  • 48
  • 1
  • 6