GithubHelp home page GithubHelp logo

flavors / django-graphql-geojson Goto Github PK

View Code? Open in Web Editor NEW
64.0 5.0 4.0 58 KB

GeoJSON support for Graphene Django

Home Page: https://pypi.python.org/pypi/django-graphql-geojson

License: MIT License

Makefile 2.07% Python 97.93%
django graphql graphene gis geojson geodjango maps filters

django-graphql-geojson's People

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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

django-graphql-geojson's Issues

Returning valid GeoJSON

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

Problems with distance_Lte Filter

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

Using of this module makes types to be incompatible with custom interfaces

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?

__init_subclass_with_meta__() got multiple values for keyword argument '_meta'

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

Is not clear in README which versions of Graphene Django supports

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?

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.