From: iceDice <nmi...@gm...> - 2009-09-28 13:25:16
|
Hello, I have problems to show data from MySQL db on map. I try to do that on following way: Map params = new HashMap(); params.put("dbtype", "mysql"); params.put("host", "localhost"); params.put("port", new Integer(3306)); params.put("database", "my_db"); params.put("user", "root"); MySQLDataStoreFactory mySQLFactory = new MySQLDataStoreFactory(); MySQLDataStore mySQLDatastore = (MySQLDataStore) mySQLFactory.createDataStore(params); // Prepare feature sources fsStreets = mySQLDatastore.getFeatureSource("streets"); When i tried to display layer on JMapFrame i can't see anything. Values for map bounds in JMapFrame Status bar (min and max Lat and Lon) are all NaN. I check ogrinfo MySQL:my_db,user=root streets -so and get: INFO: Open of `MySQL:my_db,user=root' using driver `MySQL' successful. Layer name: streets Geometry: Line String Feature Count: 930 Extent: (19.559141, 46.026719) - (19.801404, 46.168960) Layer SRS WKT: GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 84",6378137,298.257223563, AUTHORITY["EPSG","7030"]], AUTHORITY["EPSG","6326"]], PRIMEM["Greenwich",0, AUTHORITY["EPSG","8901"]], UNIT["degree",0.01745329251994328, AUTHORITY["EPSG","9122"]], AUTHORITY["EPSG","4326"]] FID Column = OGR_FID Geometry Column = SHAPE name: String (254.0) oneway: String (254.0) type: String (1.0) What can be problem here? I make table in MySQL from shapefile without .prj file with following command: ogr2ogr -f "MySQL" MYSQL:"my_db,host=localhost,user=root,port=3306" -nln "streets" -a_srs "EPSG:4326" streets.shp Also i try all of this with Postgis and everything works perfect. I hope so someone can help me about this. Best regards -- View this message in context: http://n2.nabble.com/GeoTools-MySQL-tp3729388p3729388.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. |