Exemplo n.º 1
0
	def testDistance(self):
		cs = geos.CoordinateSequence(1,2)
		cs.setX(0, 0)
		cs.setY(0, 0)
		geom1 = geos.createPoint(cs)

		cs = geos.CoordinateSequence(1,2)
		cs.setX(0, 3)
		cs.setY(0, 4)
		geom2 = geos.createPoint(cs)
		
		self.assertEqual(5, geom1.distance(geom2))
Exemplo n.º 2
0
    def testDistance(self):
        cs = geos.CoordinateSequence(1, 2)
        cs.setX(0, 0)
        cs.setY(0, 0)
        geom1 = geos.createPoint(cs)

        cs = geos.CoordinateSequence(1, 2)
        cs.setX(0, 3)
        cs.setY(0, 4)
        geom2 = geos.createPoint(cs)

        self.assertEqual(5, geom1.distance(geom2))
Exemplo n.º 3
0
	def testCreatePoint(self):
		cs = geos.CoordinateSequence(1,3)
		cs.setX(0, 7)
		cs.setY(0, 8)
		cs.setZ(0, 9)
		
		geom = geos.createPoint(cs)
		assert isinstance(geom, geos.Point)
		self.assertEqual('Point', geom.geomType())
		self.assertEqual(geos.GEOS_POINT, geom.typeId())
		
		self.assertEqual(False, geom.isEmpty())
		self.assertEqual(True, geom.isValid())
		self.assertEqual(True, geom.isSimple())
		self.assertEqual(False, geom.isRing())
		self.assertEqual(True, geom.hasZ())
		
		self.assertEqual(1, geom.getNumGeometries())

		coords = geom.getCoordSeq()
		assert isinstance(coords, geos.CoordinateSequence)
		self.assertEqual(7, coords.getX(0))
		self.assertEqual(8, coords.getY(0))
		self.assertEqual(9, coords.getZ(0))
    
		self.assertEqual(0, geom.area())
		self.assertEqual(0, geom.length())
Exemplo n.º 4
0
    def testCreatePoint(self):
        cs = geos.CoordinateSequence(1, 3)
        cs.setX(0, 7)
        cs.setY(0, 8)
        cs.setZ(0, 9)

        geom = geos.createPoint(cs)
        assert isinstance(geom, geos.Point)
        self.assertEqual('Point', geom.geomType())
        self.assertEqual(geos.GEOS_POINT, geom.typeId())

        self.assertEqual(False, geom.isEmpty())
        self.assertEqual(True, geom.isValid())
        self.assertEqual(True, geom.isSimple())
        self.assertEqual(False, geom.isRing())
        self.assertEqual(True, geom.hasZ())

        self.assertEqual(1, geom.getNumGeometries())

        coords = geom.getCoordSeq()
        assert isinstance(coords, geos.CoordinateSequence)
        self.assertEqual(7, coords.getX(0))
        self.assertEqual(8, coords.getY(0))
        self.assertEqual(9, coords.getZ(0))

        self.assertEqual(0, geom.area())
        self.assertEqual(0, geom.length())