Class GeoJSONReader

    • Method Detail

      • getFormatName

        public java.lang.String getFormatName()
        Specified by:
        getFormatName in interface ShapeIO
        Returns:
        the format name
      • read

        public final Shape read​(java.io.Reader reader)
                         throws java.io.IOException,
                                java.text.ParseException
        Description copied from interface: ShapeReader
        Read a Shape from the reader.
        Specified by:
        read in interface ShapeReader
        Parameters:
        reader - -- the input. Note, it will not be closed by this function
        Returns:
        a valid Shape (never null)
        Throws:
        java.io.IOException
        java.text.ParseException
      • read

        public Shape read​(java.lang.Object value)
                   throws java.io.IOException,
                          java.text.ParseException,
                          InvalidShapeException
        Specified by:
        read in interface ShapeReader
        Parameters:
        value - -- the input value, could be a String or other object
        Returns:
        a shape valid shape (not null)
        Throws:
        java.io.IOException
        java.text.ParseException
        InvalidShapeException
      • readCoordXYZ

        protected void readCoordXYZ​(org.noggit.JSONParser parser,
                                    ShapeFactory.PointsBuilder pointsBuilder)
                             throws java.io.IOException,
                                    java.text.ParseException
        Throws:
        java.io.IOException
        java.text.ParseException
      • readCoordListXYZ

        protected void readCoordListXYZ​(org.noggit.JSONParser parser,
                                        ShapeFactory.PointsBuilder pointsBuilder)
                                 throws java.io.IOException,
                                        java.text.ParseException
        Throws:
        java.io.IOException
        java.text.ParseException
      • readUntilEvent

        protected void readUntilEvent​(org.noggit.JSONParser parser,
                                      int event)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • readPoint

        protected Shape readPoint​(org.noggit.JSONParser parser)
                           throws java.io.IOException,
                                  java.text.ParseException
        Throws:
        java.io.IOException
        java.text.ParseException
      • readLineString

        protected Shape readLineString​(org.noggit.JSONParser parser)
                                throws java.io.IOException,
                                       java.text.ParseException
        Throws:
        java.io.IOException
        java.text.ParseException
      • readCircle

        protected Circle readCircle​(org.noggit.JSONParser parser)
                             throws java.io.IOException,
                                    java.text.ParseException
        Throws:
        java.io.IOException
        java.text.ParseException
      • readDistance

        protected double readDistance​(java.lang.String distProperty,
                                      java.lang.String distUnitsProperty,
                                      org.noggit.JSONParser parser)
                               throws java.io.IOException
        Helper method to read a up until a distance value (radius, buffer) and it's corresponding unit are found.

        This method returns 0 if no distance value is found. This method currently only handles distance units of "km".

        Parameters:
        distProperty - The name of the property containing the distance value.
        distUnitsProperty - The name of the property containing the distance unit.
        Throws:
        java.io.IOException
      • readShape

        protected Shape readShape​(org.noggit.JSONParser parser)
                           throws java.io.IOException,
                                  java.text.ParseException
        Throws:
        java.io.IOException
        java.text.ParseException
      • readShapeFromCoordinates

        protected Shape readShapeFromCoordinates​(java.lang.String type,
                                                 org.noggit.JSONParser parser)
                                          throws java.io.IOException,
                                                 java.text.ParseException
        Throws:
        java.io.IOException
        java.text.ParseException
      • readMultiPoint

        protected Shape readMultiPoint​(org.noggit.JSONParser parser)
                                throws java.io.IOException,
                                       java.text.ParseException
        Throws:
        java.io.IOException
        java.text.ParseException
      • readMultiLineString

        protected Shape readMultiLineString​(org.noggit.JSONParser parser)
                                     throws java.io.IOException,
                                            java.text.ParseException
        Throws:
        java.io.IOException
        java.text.ParseException
      • readMultiPolygon

        protected Shape readMultiPolygon​(org.noggit.JSONParser parser)
                                  throws java.io.IOException,
                                         java.text.ParseException
        Throws:
        java.io.IOException
        java.text.ParseException