flavors / django-graphql-geojson Goto Github PK
View Code? Open in Web Editor NEWGeoJSON support for Graphene Django
Home Page: https://pypi.python.org/pypi/django-graphql-geojson
License: MIT License
GeoJSON support for Graphene Django
Home Page: https://pypi.python.org/pypi/django-graphql-geojson
License: MIT License
You get the following error if you try to set
class Meta:
model = MY_MODEL
on two different GeoJsonTypes with the same model:
AssertionError: Found different types with the same name in the schema: FeatureProperties, FeatureProperties.
Really appreciate this.
Any tips on ways to set up query (or resolver function?) that returns a valid GeoJSON feature collection would be appreciated
thanks
It would be nice if there was a default description in a Meta class of the Geometry type which would describe which formats are accepted
Currently I see only support for one field per model. Is it possible to have more?
Thanks
Hello,
I want to use the distance_Lte filter as in the readme-file described. But I can´t perform the query. Can you tell me what my failure is?
My django classes:
class Location(models.Model):
calendar = models.ForeignKey(Calendar, on_delete=models.CASCADE)
name = models.CharField(max_length=255)
location = models.PointField(srid=4326, unique=True)
address = models.CharField(max_length=100)
city = models.CharField(max_length=50)
class LocationType(GeoJSONType):
class Meta:
model = Location
geojson_field = 'location'
filterset_class = LocationFilter
interfaces = (relay.Node,)
exclude = []
class LocationFilter(GeometryFilterSet):
class Meta:
model = Location
fields = {
'city': ['exact', 'icontains', 'istartswith'],
'location': ['exact', 'intersects', 'distance_lte']
}
class Query(graphene.ObjectType):
location = relay.Node.Field(LocationType)
locations = DjangoFilterConnectionField(LocationType)
My graphql-Query:
query{
locations(location_DistanceLte:{geometry:"{'type': 'Point', 'coordinates': [13.28702,52.4581]}", value:400, unit:"km"}){
edges{
node {
id
}
}
}
}
The error-msg:
{
"errors": [
{
"message": "Argument \"location_DistanceLte\" has invalid value {geometry: \"{'type': 'Point', 'coordinates': [13.28702,52.4581]}\", value: 400, unit: \"km\"}.\nExpected type \"Geometry\", found {Geometry: \"{'type': 'Point', 'coordinates': [13.28702,52.4581]}\", value: 400, unit: \"km\"}.",
"locations": [
{
"line": 2,
"column": 34
}
]
}
]
}
I don´t know, what I´m doing wrong... It would be nice if you can help.
Thanks
I have several types for which I want to make a search. I've created a Searchable interface which requires a displayName
field to be in a type and I've added the field to all appropriate types. But a type inherited from GeoJSONType doesn't conform to the Searchable interface eventually, because it's displayName
is located in properties. How can I make things work properly?
Hi there,
Looks like a very useful project! However when I run the example code, I am getting the error of the subject:
"init_subclass_with_meta() got multiple values for keyword argument '_meta'"
I traced this to init_subclass_with_meta of DjangoObjectType which at this point will have a _meta field in its properties, but it goes ahead and creates a _meta of its own and calls the super which will now receive two of them. Any thoughts on how to fix this? Seems like something changed, maybe.
Thanks,
Douwe
Great working supporting this. It has been really helpful.
I am using in my stack:
graphene==2.1.5
graphene-django==2.3.0
django-graphql-geojson==0.1.4
So far it works fine but I want to upgrade graphene-django and graphene and I am not sure whether django-graphql-geojson will support it. Would you mind telling me up to which version supports graphene-django?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.