You can do that with JTS. It's easy to load the geometry from its EWKB Hexadecimal representation, using WBKReader
.
import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.geom.GeometryFactory;
import com.vividsolutions.jts.geom.PrecisionModel;
import com.vividsolutions.jts.io.WKBReader;
import java.util.Arrays;
import java.util.List;
public class Foo {
public static void main(String... args) throws Exception {
final List<String> points = Arrays.asList(
"0101000020E6100000AECB9307F9D812400F2ADCE003704940",
"0101000020E6100000E40AAE6CD6DA1240941F95531C704940",
"0101000020E6100000C0D7C68E7CD81240F550364044704940"
);
final GeometryFactory gm = new GeometryFactory(new PrecisionModel(), 4326);
final WKBReader wkbr = new WKBReader(gm);
for (String point: points) {
byte[] wkbBytes = wkbr.hexToBytes(point);
final Geometry geom = wkbr.read(wkbBytes);
System.out.printf("%s -> %s\n", point, geom.toText());
// you can access longitude and latitude via
double longitude = geom.getCoordinate().x;
double latitude = geom.getCoordinate().y;
// then do what you need to do with it
}
}
}
Will print:
0101000020E6100000AECB9307F9D812400F2ADCE003704940 -> POINT (4.7118874725301065 50.87511835813722)
0101000020E6100000E40AAE6CD6DA1240941F95531C704940 -> POINT (4.713708589670862 50.875864455999505)
0101000020E6100000C0D7C68E7CD81240F550364044704940 -> POINT (4.71141265 50.87708285)
You may also know that JTS is on maven central, so it's easy to add a dependency to your project.
<dependency>
<groupId>com.vividsolutions</groupId>
<artifactId>jts</artifactId>
<version>1.13</version> <!-- or RELEASE as stated in @RobAu comment below -->
</dependency>
As for the magic number 4326 is a common SRID for geographic coordinates which is the longitude/latitude on the WGS84 spheroid.
You can read this link and that one about that number, and a nice introduction to all that stuff.